Archive

Archive for November, 2009

Manual binding for Flex ArrayCollection

November 10, 2009 Leave a comment

I have been pulling my hair out for a while on this!
I was manually binding an arrayCollection using mx.binding.utils.ChangeWatcher:

ChangeWatcher.watch(ModelLocator.getInstance(), "_comboChoices", prepareDataProvider);

and it did not work. After googling I have found the reason here:

http://old.nabble.com/ChangeWatcher–watch—ArrayCollection-td20594413.html

and I finally came with this single – yet working – line of code:

_modelLocator._comboChoices.addEventListener(CollectionEvent.COLLECTION_CHANGE, prepareDataProvider);

that’s it ! My prepareDataProvider function was called ! 🙂

Advertisements