
CHAPTER 4: User-Interface Tools Control objects 144
List control object functions
The following table shows the methods defined for list objects only.
show()
controlObj.show()
Shows this container or control. When a window or container is hidden, its children are also hidden,
but when it is shown again, the children retain their own visibility states.
Returns
undefined.
toString()
listItemObj.toString()
For ListItem controls only. Retrieves the value of this item’s text property as a string.
Returns a String.
valueOf()
listItemObj.valueOf()
For ListItem controls only. Retrieves the index number of this item in the parent list’s items array.
Returns a Number.
add()
listObj.add (type, text[, index])
type
The type of item to add. One of:
item—A basic, selectable item with a text label.
separator—A separator. For dropdownlist controls only. In this case, the text value
is ignored, and the method returns
null.
text
The localizable text label for the item.
index
Optional. The index into the current item list after which this item is inserted. If not
supplied, or greater than the current list length, the new item is added at the end.
For list objects (ListBox
, DropDownList or TreeView) only. Adds an item to the items array at the
given index.
Returns the
item control object for type=item, or null for type=separator.
Comentarios a estos manuales