Home > Flex, RIA > Manual binding for Flex ArrayCollection

Manual binding for Flex ArrayCollection

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
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: