Tuesday, December 6, 2011

Accessing children created in a Repeater

I'm trying to loop through all the components created inside
a %26lt;mx:Repeater%26gt; tag. I can see in the debugger that the
Repeater has an Array called 'createdComponents' inside of it -
very useful. Except that in my ''for each in'' loop, the object being
returned is a UIComponentDescriptor and not the UIComponent itself.



How can I loop through all the UIComponents generated by the
Repeater?




Accessing children created in a Repeater
Now the compiler won't compile, it's telling me that I can't
access the createdComponents Array inside the Repeater. Also, it's
saying that Repeater.numChildren is 0 - lies! There are 25
UIComponents in there. I can see them.Accessing children created in a Repeater
It looks like the answer was to perform the ''for each'' loop
over the Repeater.container.
Also: If you give your repeated component an id, say myComp,
then you can reference the repeated instances using:

myComp[n]

Where ''n'' is the index of the dataProvider item.

Tracy
Awesome - I'll give that a shot

No comments:

Post a Comment