Class HtmlSelection
This widget corresponds to pull-down inside a form where the user can
select one entry from a fixed set of entries. The pull down contains
a set of entries. Each entry is composed of a value and a label. The
label is displayed in the visual representation. The value is used
to identify the entry. The entry that is active is the one whose
label gets displayed in the pull-down. When no entry is active it is
the first entry that gets displayed.
The HtmlSelection supports the following attributes:
- name -
String representing the name that is associated with the component.
activate index
Activates one of the entries in the pull-down given its index.
|
activateWith value
Activates one of the entries in the pull-down given its value.
|
addEntries entriesList
Adds a set of entries to the pull down.
|
addEntry value label
Adds an entry to the pull down.
|
clear
Removes all the entries from the pull-down.
|
constructor
Initializes the object.
|
getActiveIndex
Fetches the index of the currently active entry.
|
getActiveLabel
Fetches the label associated with the currently active entry.
|
getActiveValue
Fetches the value associated with the currently active entry.
|
getEntryCount
Fetches the current number of entries in the pull-down.
|
|
activate
HtmlSelection activate index
Activates one of the entries in the pull-down given its index.
- Parameters:
- index -
Integer representing the index of the entry to activate. The first
entry has index zero.
- Returns:
-
A reference to the object for which the method was called.
-
This method specifies the entry that gets displayed in the pull-down.
If
index is negative or equal to or greater than the
number of entries in the pull-down than the first entry gets
displayed.
activateWith
HtmlSelection activateWith value
Activates one of the entries in the pull-down given its value.
- Parameters:
- value -
An object that is supposed to the same as one of those associated
with the pull-down entries.
- Returns:
-
A reference to the object for which the method was called.
-
This method specifies the entry that gets displayed in the pull-down.
If
value is not one of the values associated with the
entries than the first entry gets displayed.
addEntries
HtmlSelection addEntries entriesList
Adds a set of entries to the pull down.
- Parameters:
- entriesList -
List where each element represents an entry to be added to the
pull-down.
- Returns:
-
A reference to the object for which the method was called.
-
The entries are added to the end of the list of previously added
entries in the same order as they apear in
entriesList.
Each element of entriesList represents an entry and
is a list of two elements. The first element is the entry value and
the second element is the entry label.
addEntry
HtmlSelection addEntry value label
Adds an entry to the pull down.
- Parameters:
- value -
An object that is associated with the entry. It must be a string.
- label -
A string representing the label that is displayed for the entry.
- Returns:
-
A reference to the object for which the method was called.
-
The entry is added to the end of the list of previously added entries.
clear
HtmlSelection clear
Removes all the entries from the pull-down.
- Returns:
-
A reference to the object for which the method was called.
-
constructor
HtmlSelection constructor
Initializes the object.
-
getActiveIndex
HtmlSelection getActiveIndex
Fetches the index of the currently active entry.
- Returns:
-
An integer representing the index of the currently active entry.
-
getActiveLabel
HtmlSelection getActiveLabel
Fetches the label associated with the currently active entry.
- Returns:
-
The string that is the label of the currently active entry or
null if no entry is activated.
-
getActiveValue
HtmlSelection getActiveValue
Fetches the value associated with the currently active entry.
- Returns:
-
The object that is the value associated with the currently
active entry or null if no entry is selected.
-
getEntryCount
HtmlSelection getEntryCount
Fetches the current number of entries in the pull-down.
- Returns:
-
Integer representing the current number of entries in the pull-down.
-
Report a bug or request new features
© 2013