Dynamically Repeating Controls and Containers

This chapter describes how to use the Repeater object. The Repeater object lets you dynamically repeat any number of controls or containers specified in MXML tags, at runtime.

The Repeater object is useful for repeating a small set of simple user-interface components, such as RadioButton controls and other controls typically used in Form containers. A component is repeated based on an array of dynamic data, such as an Array object returned from a web service. For example, using just one <mx:RadioButton> tag and one <mx:Repeater> tag, you can generate a RadioButton control for each element in an Array object.

For most cases in which you would use the Repeater object in Macromedia Flex 1.0, you can now use the HorizontalList, TileList, or List control for better performance when displaying any more than a few objects. Unlike the Repeater object, which instantiates all objects that are repeated, the HorizontalList, TileList, and List controls only instantiate what is visible in the list.

The HorizontalList control is a list control that displays data horizontally, much like the HBox container. The HorizontalList control always displays items from left to right. For more information, see HorizontalList control.

The TileList control is a list control that displays data in a tile layout, much like the Tile container. The TileList control provides a direction property that determines if the next item is down or to the right. For more information, see TileList control.

The List control displays data in a single vertical column. For more information, see List control.

Contents

Using the Repeater object
Considerations when using a Repeater object

Version 1.5

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000416.htm