User Guide

List class 771
A row is a component that is used to display an item. Rows are either supplied by default by
the list (the SelectableRow class is used), or you can supply them, usually as a subclass of the
SelectableRow class. The SelectableRow class implements the CellRenderer API, which is the
set of properties and methods that allow the list to manipulate each row and send data and
state information (for example, size, selected, and so on) to the row for display.
A data provider is a data model of the list of items in a list. Any array in the same frame as a
list is automatically given methods that let you manipulate data and broadcast changes to
multiple views. You can build an Array instance or get one from a server and use it as a data
model for multiple lists, combo boxes, data grids, and so on. The List component has
methods that proxy to its data provider (for example,
addItem() and removeItem()). If no
external data provider is provided to the list, these methods create a data provider instance
automatically, which is exposed through
List.dataProvider.
To add a List component to the tab order of an application, set its
tabIndex property (see
UIComponent.tabIndex). The List component uses the Focus Manager to override the
default Flash Player focus rectangle and draw a custom focus rectangle with rounded corners.
For more information, see “Creating custom focus navigation” in Using Components.
Each component class has a
version property, which is a class property. Class properties are
available only on the class itself. The
version property returns a string that indicates the
version of the component. To access this property, use the following code:
trace(mx.controls.List.version);
Method summary for the List class
The following table lists methods of the List class.
NOTE
The code trace(myListInstance.version); returns undefined.
Method Description
List.addItem() Adds an item to the end of the list.
List.addItemAt() Adds an item to the list at the specified index.
List.getItemAt() Returns the item at the specified index.
List.removeAll() Removes all items from the list.
List.removeItemAt() Removes the item at the specified index.
List.replaceItemAt() Replaces the item at the specified index with another item.
List.setPropertiesAt() Applies the specified properties to the specified item.