Different data objects may set the oldValue/newValue correctly.  I'm not
sure what kind of generic object you are using for testing, but it may
not be generating the info when some other kind of object (maybe a
[Bindable] or [Managed] object will.  If the item is a plain old Object,
the DG does not generate oldValue/newValue info.  You can subclass a  DG
so it will, but if you know in production mode you'll be working with
server objects, they are more likely to provide more information

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of lampei
Sent: Friday, July 25, 2008 2:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: PropertyChangeEvent problems in
ArrayCollection

 

That's the problem I'm having...the property is dynamic and can be
filled with whatever data they pass to the arrayCollection, such as
filling it with a query they receive from their back end, or just
passing in generic objects (which is what I'm using to test).

They could then, perhaps, bind this arraycollection to an editable
datagrid, and the user will edit one item in one of the rows, which
will update the arrayCollection, but this update does not pass what
the oldValue was, so I'm unable to get an accurate history. And this
is where I find myself currently.

If I had access to the datagrid, then I'd be able to grab the data
before it was passed back to arraycollection, but I'm trying to make
the arraycollection as loosely coupled as possible, as really don't
want to put it directly into a datagrid.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> What is the property that is changing? I think you may need to have
> your own code generate the proper change event.
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of lampei
> Sent: Friday, July 25, 2008 7:02 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] PropertyChangeEvent problems in ArrayCollection
> 
> 
> 
> I am trying to keep track of changes to an ArrayCollection. I have so
> far got all of the CollectionEventKind working except for UPDATE. It
> actually does add that a change was made for UPDATE, however, it
> doesn't actually save what the change was that was made.
> 
> e.g. CollectionChange fires, and I store it in an ArrayCollection.
> However, when I debug what was actually stored, I get a
> CollectionEvent, with an "items" array of 1 PropertyChangeEvent, which
> has a source object with the new values and shows the correct property
> that was changed, however, both the newValue and oldValue properties
> of the PropertyChangeEvent are both null.
> 
> I'm trying to figure out how to get at the data before it is changed.
> I capture the CollectionChange event, but at that point, the data has
> already changed (as is evidenced by the PropertyChangeEvent showing
> the new values and none of the old values).
> 
> Does anyone know what I can override to capture the changes before
> they are actually made to the ArrayCollection itself. This way I
> could even use my own createUpdateEvent to store the values.
> 
> Thanks.
> Gareth
>

 

Reply via email to