Search Flex Components Free

Custom Search

December 5, 2007

Flex3.0 Building an advanced user interface

Table of contents
Using the Repeater component
Skinning your components
Using item renderers
Creating item editors
Using data providers
Adding drag-and-drop support
Working with Tree controlsNew!

Using the Repeater component
Repeater components are useful for repeating a small set of simple user interface components, such as RadioButton controls and other controls typically used in Form containers. You generally control repetition by using an array of dynamic data, such as an Array object returned from a web service, but you can use static arrays to emulate simple for loops.
You use the tag to declare a Repeater component that handles repetition of one or more user interface components based on dynamic or static data arrays at run time. The repeated components can be controls or containers. Using a Repeater component requires data binding to allow for run-time-specific values.
You can use the tag anywhere that you can use a control or container tag. To repeat user interface components, you place their tags within the tag. All components derived from the UIComponent class can be repeated with the exception of the container tag. You can also use more than one tag in an MXML document, and you can nest tags.
Although Repeater components look like containers in your code, they are not containers and have none of the automatic layout functionality of containers. Their sole purpose is to specify a series of subcomponents to include in your application one or more times based on the contents of a specified data provider. To align items that a repeater generates or perform any other layout task, place the Repeater component and its contents inside a container and apply the layout to that container.
For example, the following snippet creates a number of RadioButton controls based on an ArrayCollection of products, each of which contains a name property. Setting the layout property of the Panel container to "horizontal" makes the RadioButton controls appear side-by-side in a row.

Related Flex Tutorials