
Public Member Functions | |
| __construct ($name, $multiple=false, $size=0) | |
| Creates a new select box. | |
| addOption ($value, $label) | |
| Adds an item/option to the select box. | |
| getOptions () | |
| Returns a list of all the options that have been added so far. | |
| getSelectedIndex () | |
| Returns the numerical index of the initially selected item. | |
| makeString ($prop, $newValue) | |
| INSERT BRIEF DESCRIPTION HERE. | |
Static Public Member Functions | |
| static | createFromXML ($attrs, $contents, $node) |
Protected Member Functions | |
| renderComponent ($class, $style, $events, $id) | |
This class corresponds to the HTML select tag. It also has supports for events that are triggered when changing the selection. When used in TK XML, each item is specified with a <item> tag, which must have a 'value' attribute. The content of the tag is used as the label, or display value. If there is a 'selected' attribute on the item tag and the value of the attribute is 'true', then the item is set as the initially selected item. Should there be multiple item tags with a 'selected="true"' attribute, only the last one will count.
string: name of initially selected element boolean: if true, then a multi-select box is used, otherwise a drop-down is used
Definition at line 23 of file TKSelect.php5.
| TKSelect::__construct | ( | $ | name, | |
| $ | multiple = false, |
|||
| $ | size = 0 | |||
| ) |
Creates a new select box.
| $name | [string]: form element name | |
| $multiple | [boolean]: whether to have multi-select (true) or drop-down (false) | |
| $size | [int]: if $multiple is true, the number of rows in the selector box |
Definition at line 35 of file TKSelect.php5.
References TKComponent::addProperty(), TKComponent::setAction(), and TKComponent::setPropChangeListener().
| TKSelect::addOption | ( | $ | value, | |
| $ | label | |||
| ) |
Adds an item/option to the select box.
The value is what the whole select element is set to when the user submits the form. The label is what is displayed to the user for that item.
| $value | [string]: item value | |
| $label | [string]: what the user sees |
Definition at line 78 of file TKSelect.php5.
References TKComponent::addEvent().
| static TKSelect::createFromXML | ( | $ | attrs, | |
| $ | contents, | |||
| $ | node | |||
| ) | [static] |
For internal use only.
Reimplemented from TKFormElement.
Definition at line 147 of file TKSelect.php5.
| TKSelect::getOptions | ( | ) |
Returns a list of all the options that have been added so far.
Definition at line 94 of file TKSelect.php5.
| TKSelect::getSelectedIndex | ( | ) |
Returns the numerical index of the initially selected item.
Definition at line 103 of file TKSelect.php5.
| TKSelect::makeString | ( | $ | prop, | |
| $ | newValue | |||
| ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $prop | [TYPE]: DESCRIPTION | |
| $newValue | [TYPE]: DESCRIPTION |
Definition at line 59 of file TKSelect.php5.
| TKSelect::renderComponent | ( | $ | class, | |
| $ | style, | |||
| $ | events, | |||
| $ | id | |||
| ) | [protected] |
For internal use only.
Reimplemented from TKComponent.
Definition at line 119 of file TKSelect.php5.
References TKFormElement::getStandardProperties().
1.5.6