Interchange

Archive for May, 2009

Binding on Repeaters - a magic trick?

by hbomb on May.22, 2009, under Flex

The pledge: An ArrayCollection of ObjectProxy objects nested within another ArrayCollection. As the ObjectProxy objects are updated, the view should update accordingly.

The turn: However, this doesn’t seem to be the case. By watching the screen, we see that only the initial setup is run. We try to refresh the base ArrayCollection. Nothing happens.

The prestige: By moving the refresh to the inner ArrayCollection, we get the result we’re looking for: the repeater data updating appropriately.

Tada!

Unfortunately, this took far too long for me to figure out. I was investigating ObjectProxy as I thought that it might not be sending the propertyUpdated event (it was) and all manner of other things. Then it occurred to me: maybe the internal ArrayCollection is not updating.

They say a good magician never reveals his tricks, and that if he does, then the illusion is ruined for the audience. I think the relief of solving this bedeviling problem is worth the ruination of the illusion.

Leave a Comment :, , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...