[flexcoders] Problem detecting data change in a List

2007-08-24 Thread williamkusumo
Hi!

I have a List bound to an ArrayCollection. And this List is draggable,
so you can re-arrange the items. You can also remove or add stuff to it.

I would like to do something when the List is modified, but
'dataChange' doesn't seem to work. Anyone has any idea? 'change' is
not what I want since it only detects changes to
selectedItem/selectedIndex.

I've thought about putting an event listener on the ArrayCollection
itself, but the problem is the ArrayCollection can be null under some
circumstances.

Any help appreciated!



RE: [flexcoders] Problem detecting data change in a List

2007-08-24 Thread Gordon Smith
I think you want to listen to collectionChange on the ArrayColleciton
itself, and arrange for it to be empty instead of null.
 
But if you really must know when the dataProvider property becomes null,
I think you'll need to subclass List and override the dataProvider
setter.
 
- Gordon



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of williamkusumo
Sent: Friday, August 24, 2007 9:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problem detecting data change in a List



Hi!

I have a List bound to an ArrayCollection. And this List is draggable,
so you can re-arrange the items. You can also remove or add stuff to it.

I would like to do something when the List is modified, but
'dataChange' doesn't seem to work. Anyone has any idea? 'change' is
not what I want since it only detects changes to
selectedItem/selectedIndex.

I've thought about putting an event listener on the ArrayCollection
itself, but the problem is the ArrayCollection can be null under some
circumstances.

Any help appreciated!