Class \Prado\Web\UI\WebControls\TDropDownList
TDropDownList displays a dropdown list on a Web page. It inherits all properties and events from 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 <com:TListItem Attributes.Group="Group Name" .../> 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 \Prado\Web\UI\WebControls\setPromptText or \Prado\Web\UI\WebControls\setPromptValue, 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 \Prado\Web\UI\WebControls\getSelectedIndex property is not affected by a prompt item: the items list will still be zero-based.
The \Prado\Web\UI\WebControls\clearSelection method will select the prompt item if existing, otherway the first available item in the dropdown list will be selected.
Class hierarchy
- \Prado\Web\UI\WebControls\TDropDownList implements IPostBackDataHandler, IValidatable
- \Prado\Web\UI\WebControls\TListControl implements IDataRenderer
- \Prado\Web\UI\WebControls\TDataBoundControl
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
getDataChanged() : bool
Returns a value indicating whether postback has caused the control data change.
This method is required by the \Prado\Web\UI\IPostBackDataHandler interface. |
public
|
|
public
|
getValidationPropertyValue() : string
Returns the value to be validated.
This methid is required by \Prado\Web\UI\IValidatable interface. |
public
|
loadPostData(string $key, array<string|int, mixed> $values) : bool
Loads user input data.
This method is primarly used by framework developers. |
public
|
raisePostDataChangedEvent() : mixed
Raises postdata changed event.
This method is required by IPostBackDataHandler interface. It is invoked by the framework when \Prado\Web\UI\WebControls\getSelectedIndex property is changed on postback. This method is primarly used by framework developers. |
public
|
|
public
|
|
protected
|
|
protected
|
getClientClassName() : string
Gets the name of the javascript class responsible for performing postback for this control.
This method overrides the parent implementation. |