PHP Class Prado\Web\UI\WebControls\TCheckBoxList

TCheckBoxList displays a list of checkboxes on a Web page. The layout of the checkbox list is specified via {@link setRepeatLayout RepeatLayout}, which can be either 'Table' (default) or 'Flow'. A table layout uses HTML table cells to organize the checkboxes while a flow layout uses line breaks to organize the checkboxes. When the layout is using 'Table', {@link setCellPadding CellPadding} and {@link setCellSpacing CellSpacing} can be used to adjust the cellpadding and cellpadding of the table. The number of columns used to display the checkboxes is specified via {@link setRepeatColumns RepeatColumns} property, while the {@link setRepeatDirection RepeatDirection} governs the order of the items being rendered. The alignment of the text besides each checkbox can be specified via {@link setTextAlign TextAlign}.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TListControl, implements IRepeatInfoUser, implements Prado\Web\UI\INamingContainer, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable
显示文件 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
findControl ( $id, $real = false ) : TControl Finds a control by ID.
generateItemStyle ( $itemType, $index ) : null Returns a style used for rendering items.
getCellPadding ( ) : integer
getCellSpacing ( ) : integer
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getHasFooter ( ) : boolean Returns a value indicating whether this control contains footer item.
getHasHeader ( ) : boolean Returns a value indicating whether this control contains header item.
getHasSeparators ( ) : boolean Returns a value indicating whether this control contains separator items.
getIsValid ( ) : boolean Returns true if this control validated successfully.
getRepeatColumns ( ) : integer
getRepeatDirection ( ) : string
getRepeatLayout ( ) : string
getTextAlign ( ) : TTextAlign
getValidationPropertyValue ( ) : mixed Returns the value to be validated.
loadPostData ( $key, $values ) : boolean Loads user input data.
onPreRender ( $param ) Registers for post data on postback.
raisePostDataChangedEvent ( ) Raises postdata changed event.
render ( $writer ) Renders the checkbox list control.
renderItem ( $writer, $repeatInfo, $itemType, $index ) Renders an item in the list.
setCellPadding ( $value ) Sets the cellpadding for the table keeping the checkbox list.
setCellSpacing ( $value ) Sets the cellspacing for the table keeping the checkbox list.
setEnabled ( $value )
setIsValid ( $value )
setRepeatColumns ( $value )
setRepeatDirection ( $value )
setRepeatLayout ( $value )
setTextAlign ( $value )

Protected Methods

Method Description
createRepeatedControl ( ) : TControl Creates a control used for repetition (used as a template).
createStyle ( ) : TStyle Creates a style object for the control.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getIsMultiSelect ( ) : boolean
getPostBackOptions ( ) : array Gets the post back options for this checkbox.
getRepeatInfo ( ) : TRepeatInfo
getSpanNeeded ( ) : boolean Wether the list should be rendered inside a span or not

Method Details

__construct() public method

Remember to call parent implementation if you override this method
public __construct ( )

createRepeatedControl() protected method

Creates a control used for repetition (used as a template).
protected createRepeatedControl ( ) : TControl
return TControl the control to be repeated

createStyle() protected method

This method creates a {@link TTableStyle} to be used by checkbox list.
protected createStyle ( ) : TStyle
return TStyle control style to be used

findControl() public method

This method overrides the parent implementation so that it always returns the checkbox list itself (because the checkbox list does not have child controls.)
public findControl ( $id, $real = false ) : TControl
return TControl control being found

generateItemStyle() public method

This method is required by {@link IRepeatInfoUser} interface.
public generateItemStyle ( $itemType, $index ) : null
return null

getCellPadding() public method

public getCellPadding ( ) : integer
return integer the cellpadding for the table keeping the checkbox list. Defaults to -1, meaning not set.

getCellSpacing() public method

public getCellSpacing ( ) : integer
return integer the cellspacing for the table keeping the checkbox list. Defaults to -1, meaning not set.

getClientClassName() protected method

This method overrides the parent implementation.
protected getClientClassName ( ) : string
return string the javascript class name

getDataChanged() public method

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
return boolean whether postback has caused the control data change. False if the page is not in postback mode.

getHasFooter() public method

This method is required by {@link IRepeatInfoUser} interface.
public getHasFooter ( ) : boolean
return boolean always false.

getHasHeader() public method

This method is required by {@link IRepeatInfoUser} interface.
public getHasHeader ( ) : boolean
return boolean always false.

getHasSeparators() public method

This method is required by {@link IRepeatInfoUser} interface.
public getHasSeparators ( ) : boolean
return boolean always false.

getIsMultiSelect() protected method

protected getIsMultiSelect ( ) : boolean
return boolean whether this control supports multiple selection. Always true for checkbox list.

getIsValid() public method

Defaults to true.
public getIsValid ( ) : boolean
return boolean wether this control validated successfully.

getPostBackOptions() protected method

Gets the post back options for this checkbox.
protected getPostBackOptions ( ) : array
return array

getRepeatColumns() public method

public getRepeatColumns ( ) : integer
return integer the number of columns that the list should be displayed with. Defaults to 0 meaning not set.

getRepeatDirection() public method

public getRepeatDirection ( ) : string
return string the direction of traversing the list, defaults to 'Vertical'

getRepeatInfo() protected method

protected getRepeatInfo ( ) : TRepeatInfo
return TRepeatInfo repeat information (primarily used by control developers)

getRepeatLayout() public method

public getRepeatLayout ( ) : string
return string how the list should be displayed, using table or using line breaks. Defaults to 'Table'.

getSpanNeeded() protected method

Wether the list should be rendered inside a span or not
protected getSpanNeeded ( ) : boolean
return boolean true if we need a span

getTextAlign() public method

public getTextAlign ( ) : TTextAlign
return TTextAlign the alignment of the text caption, defaults to TTextAlign::Right.

getValidationPropertyValue() public method

This methid is required by \Prado\Web\UI\IValidatable interface.
public getValidationPropertyValue ( ) : mixed
return mixed the value of the property to be validated.

loadPostData() public method

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
return boolean whether the data of the control has been changed

onPreRender() public method

This method overrides the parent implementation.
public onPreRender ( $param )

raisePostDataChangedEvent() public method

This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface. It is invoked by the framework when {@link getSelectedIndices SelectedIndices} property is changed on postback. This method is primarly used by framework developers.

render() public method

This method overrides the parent implementation.
public render ( $writer )

renderItem() public method

This method is required by {@link IRepeatInfoUser} interface.
public renderItem ( $writer, $repeatInfo, $itemType, $index )

setCellPadding() public method

Sets the cellpadding for the table keeping the checkbox list.
public setCellPadding ( $value )

setCellSpacing() public method

Sets the cellspacing for the table keeping the checkbox list.
public setCellSpacing ( $value )

setEnabled() public method

public setEnabled ( $value )

setIsValid() public method

public setIsValid ( $value )

setRepeatColumns() public method

public setRepeatColumns ( $value )

setRepeatDirection() public method

public setRepeatDirection ( $value )

setRepeatLayout() public method

public setRepeatLayout ( $value )

setTextAlign() public method

public setTextAlign ( $value )