I'd agree with everything that you said, except for the last portion: > There is no general property watching in AS, so you have to define > contracts and use events and whatnot.
Take a look at the ObjectProxy class, refenced below: http://livedocs.adobe.com/flex/201/langref/mx/utils/ObjectProxy.html By wrapping the object that you're interested in into an ObjectProxy, you can get notified by any changes to the new object (just use your new object in place of your old object). Regards, Bruce --- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > In the mx.controls.DataGrid, the dataProvider property is not a var, it > is a get/set function pair. When someone assigns dataProvider, the set > function is called so we know it changed. > > > > All dataProviders must implement ICollectionView or will be wrapped in > an ICollectionView. When you change things in an ICollectionView, the > contract is the ICollectionView will spew events which the DataGrid is > listening for. > > > > There is no general property watching in AS, so you have to define > contracts and use events and whatnot. > > > > -Alex > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Greg McCreath > Sent: Sunday, March 11, 2007 3:36 AM > To: [email protected] > Subject: [flexcoders] Data binding: How to detect data change has > happened? > > > > Hi all, > > > > I'm interested to know how in an object with a data binding I can detect > a change in the datasource. > > > > For example, if I were to develop (say) a custom datagrid that (in MXML) > a user of that datagrid can set the datasource property to something > like "{blah.blahblah}". > > > > Then, in that custom datagrid how do I detect that that blah.blahblah > has changed and take some action when it does? In the custom component > I do not want to know of the existence of blah.blahblah, just that it > has changed and what its new value is. > > > > All help appreciated. > > > > Greg. > > ________________________________ > > This email and any files transmitted with it may be confidential and are > intended solely for the use of the individual or entity to whom they are > addressed. This email may contain personal information of individuals, > and be subject to Commonwealth and/or State privacy laws in Australia. > This email is also subject to copyright. If you are not the intended > recipient, you must not read, print, store, copy, forward or use this > email for any reason, in accordance with privacy and copyright laws. If > you have received this email in error, please notify the sender by > return email, and delete this email from your inbox. >

