PHP Class Prado\Web\UI\WebControls\TDropDownList

TDropDownList displays a dropdown list on a Web page. It inherits all properties and events from {@link TListControl}. Since v3.0.3, TDropDownList 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 v3.1.1, TDropDownList starts to support prompt text. That is, a prompt item can be displayed as the first list item by specifying either {@link setPromptText PromptText} or {@link setPromptValue PromptValue}, or both. Choosing the prompt item will unselect the TDropDownList. When a prompt item is set, its index in the list is set to -1. So, the {@link getSelectedIndex SelectedIndex} property is not affected by a prompt item: the items list will still be zero-based. The {@link clearSelection clearSelection} method will select the prompt item if existing, otherway the first available item in the dropdown list will be selected.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TListControl, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable
Exibir arquivo 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.
getValidationPropertyValue ( ) : mixed Returns the value to be validated.
loadPostData ( $key, $values ) : boolean Loads user input data.
raisePostDataChangedEvent ( ) Raises postdata changed event.
setIsValid ( $value )
setSelectedIndices ( $indices )

Protected Methods

Method Description
addAttributesToRender ( $writer ) Adds attributes to renderer.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.

Method Details

addAttributesToRender() protected method

Adds attributes to renderer.
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.

getIsValid() public method

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

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

raisePostDataChangedEvent() public method

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

setIsValid() public method

public setIsValid ( $value )

setSelectedIndices() public method

public setSelectedIndices ( $indices )