0 Replies Latest reply on Jul 24, 2007 9:04 AM by AndyWW

    Collection change event updates

    AndyWW Level 1
      I have been struggling with this problem for a few hours, and I have exhausted my knowledge! I have defined a class that extends the ArrayCollection class. In the new class I have overridden the "set source()" function from ArrayCollection to add an event listener for the collection change event:

      list.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleCollectionChangeEvent);

      In the "handleCollectionChangeEvent()" function (defined in the new class) I have a "switch" statement which checks the "event.kind" property for the CollectionEvent that is passed into the function, and performs specific actions for the "add", "remove", and "update" values of this property. I am having a problem with the "update" condition. When I loop through the "items" Array in the event I am casting each entry to the PropertyChangeEvent class. But when I look at the "oldValue" and "newValue" properties of the PropertyChangeEvent object(s) I see null values every time. Also, the "currentTarget" property has a null value. The "source" property is a reference to the new values for the changed object, and the "property" property has the correct field name for the changed field.

      I would really appreciate any suggestions or help! Thank you!