class %ZEN.Component.listBox
extends abstractListBox
This is a listBox control implemented using HTML primitives.
It offers some features not provided by the HTML select control.
In addition it solves many of the problems found in the
Internet Explorer version of the select control (such as problems
interoperating with CSS).
The contents displayed by the combobox dropdown list are
defined using a set of %ZEN.Auxiliary.option objects.
For example:
<listBox>
<option value="1" text="Apple" />
<option value="2" text="Banana"/>
</listBox>
The listBox control will support both drag and drop. If
dragEnabled is true, then the user can drag values
from the list box and drop them on other drop-enabled components.
If
dropEnabled is true, then values can be dropped
onto the list. They will be appended to the end of the list.
If both drag and drop are enabled, then it is also possible to move
items within this listBox using the mouse.
property options
as list of %ZEN.Auxiliary.option(XMLELEMENTREF=1,XMLPROJECTION="ELEMENT",XMLREF=1,XMLTYPECONSTRAINT="CHOICE",ZENSETTING=0);
Set of options displayed within the combobox.
method %SetDefaultValues()
This method fills in reasonable default values for
this control. Used by tools (such as Control Tester) to
dynamically create controls.
method appendOption(value, text, style)
[ Language = javascript ]
Create a new option and append it to this listBox.
If text is omitted, then value is used as the display value.
method dropStartHandler(dragData)
[ Language = javascript ]
Default drop handler for listBox components.
method getOptionCount()
[ Language = javascript ]
Return number of items in list.
This must be overridden in subclasses.
method getOptionText(idx)
[ Language = javascript ]
Return the display text for the given item (0-based) in the dropdown list.
method getOptionValue(idx)
[ Language = javascript ]
Return the logical value of the given item (0-based) in the dropdown list.
method insertOption(index, value, text, style)
[ Language = javascript ]
Create a new option and insert it into the set of listBox options.
The new option is inserted immediately before the option with index
index.
If text is omitted, then value is used as the display value.
method moveOption(index, newIndex)
[ Language = javascript ]
Move the option at position index to position
newIndex (0-based). Slide other options if need be.
method onloadHandler()
[ Language = javascript ]
This client event, if present, is fired when the page is loaded.
method removeOption(index)
[ Language = javascript ]
Remove an option from this listBox.
index is the index number (0-based) of the option.
method resetOptions()
[ Language = javascript ]
Remove all options from this listBox.
Clears the current value of the listBox.
If there is a value for valueList it is cleared as well.
method setOption(index, value, text, style)
[ Language = javascript ]
Set the properties of an option within this listBox.
index is the index number (0-based) of the option.
If text is omitted, then value is used as the display value.