Skip binding, set the dataprovider in a result handler from the server

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wubac1
Sent: Friday, August 29, 2008 2:02 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Binding an ICollectionView completely in ActionScript to 
a ComboBox


I have a paged collection that implements the ICollectionView
interface and can be bound the the dataProvider property of a
component in MXML. However, doing this with a ComboBox can result in
an empty dropdown if the dropdown is opened before the PagedCollection
can retrieve an initial page. Once the initial page is retrieved, the
ComboBox works fine. So, I'd like to avoid the initial timing related
problem by binding to the ComboBox after I know the initial page of
the PagedCollection is loaded (by way of a COLLECTION_CHANGE event).
In order to do this, I suspect it is best to perform the binding
completely in actionscript. I have looked at the code generated when
binding an ICollectionView to a ComboBox in MXML. The generated code
uses Binding and PropertyWatcher objects. While I could copy this
exactly, I'm wondering if BindingUtils.bindSetter and the returned
ChangeWatcher can be used instead. Thoughts on the best practice for
performing this binding completely in ActionScript? Example code
appreciated.

Reply via email to