PHP Class Prado\Web\UI\WebControls\TListBox

TListBox displays a list box on a Web page that allows single or multiple selection. The list box allows multiple selections if {@link setSelectionMode SelectionMode} is TListSelectionMode::Multiple. It takes single selection only if Single. The property {@link setRows Rows} specifies how many rows of options are visible at a time. See {@link TListControl} for inherited properties. Since v3.0.3, TListBox starts to support optgroup. To specify an option group for a list item, set a Group attribute with it, $listitem->Attributes->Group="Group Name"; or in template
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TListControl, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable
显示文件 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getIsValid ( ) : boolean Returns true if this control validated successfully.
getRows ( ) : integer
getSelectionMode ( ) : TListSelectionMode
getValidationPropertyValue ( ) : mixed Returns the value to be validated.
loadPostData ( $key, $values ) : boolean Loads user input data.
onPreRender ( $param ) Registers the list control to load post data on postback.
raisePostDataChangedEvent ( ) Raises postdata changed event.
setIsValid ( $value )
setRows ( $value )
setSelectionMode ( $value )

Protected Methods

Method Description
addAttributesToRender ( $writer ) Adds attribute name-value pairs to renderer.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getIsMultiSelect ( ) : boolean

Method Details

addAttributesToRender() protected method

This method overrides the parent implementation with additional list box specific attributes.
protected addAttributesToRender ( $writer )

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.

getIsMultiSelect() protected method

protected getIsMultiSelect ( ) : boolean
return boolean whether this control allows multiple selection

getIsValid() public method

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

getRows() public method

public getRows ( ) : integer
return integer the number of rows to be displayed in the list control

getSelectionMode() public method

public getSelectionMode ( ) : TListSelectionMode
return TListSelectionMode the selection mode (Single, Multiple). Defaults to TListSelectionMode::Single.

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 component 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.

setIsValid() public method

public setIsValid ( $value )

setRows() public method

public setRows ( $value )

setSelectionMode() public method

public setSelectionMode ( $value )