Specifications
87ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
<mx:List id="birdlist" rowHeight="150" width="250" rowCount="1"
itemRenderer="mx.controls.Image" creationComplete="initCatalog()">
</mx:List>
</mx:Panel>
</mx:Application>
Using the Repeater control
When using a Repeater control, keep the following techniques in mind:
• Avoid repeating objects that have clip masks because using clip masks is a resource- intensive process.
• Ensure that the containers used as the children of the Repeater control do not have unnecessary container
nesting and are as small as possible. If a single instance of the repeated view takes a noticeable amount of time to
instantiate, repeating makes it worse. For example, multiple Grid containers in a Repeater object do not perform
well because Grid containers themselves are resource-intensive containers to instantiate.
• Set the recycleChildren property to true. The recycleChildren property is a Boolean value that, when
set to
true, binds new data items into existing Repeater children, incrementally creates children if there are more
data items, and destroys extra children that are no longer required.
The default value of the recycleChildren property is false to ensure that you do not leave stale state infor-
mation in a repeated instance. For example, suppose you use a Repeater object to display photo images and
each Image control has an associated NumericStepper control for how many prints you want to order. Some
of the state information, such as the image, comes from the
dataProvider property. Other state information,
such as the print count, is set by user interaction. If you set the
recycleChildren property to true and page
through the photos by incrementing the Repeater object's
startingIndex value, the Image controls bind to
the new images, but the NumericStepper control maintains the old information. Use
recycleChildren="false" only if it is too cumbersome to reset the state information manually, or if you
are confident that modifying your
dataProvider property should not trigger a recreation of the Repeater
object’s children.
Keep in mind that the recycleChildren property has no effect on a Repeater object’s speed when the
Repeater object loads the first time. The
recycleChildren property improves performance only for subse-
quent changes to the Repeater control’s data provider. If you know that your Repeater object creates children
only once, you do not have to use the
recycleChildren property or worry about the stale state situation.










