If you use are using Flex remoting, and you have a nested ArrayCollection, make sure that you compile the Flex VO class behind that ArrayCollection into your SWF by referring to it somewhere. Otherwise, you will ManagedObjectProxy classes instead of the concrete Flex VO type when Flex does the deserialization.
E.g. say you have a class like:
[Managed]
[RemoteClass(alias="com.adobe.watson.vo.ParentVO")]
public class ParentVO
{
public var notes:ArrayCollection; //holds NoteVO objects
}
And then NoteVO is declared as follows
[Managed]
[RemoteClass(alias="com.adobe.watson.vo.Note")]
public class NoteVO implements IValueObject
Somewhere in your code you need to have referenced NoteVO or it won’t compile into your SWF. Usually you will do this anyway because you will use notes but in cases like using data binding, perhaps you might not otherwise ever refer to NoteVO and in this case Flex won’t use it as the concrete class for the notes ArrayCollection and you might get unexpected results.
Powered by ScribeFire.

No comments yet
Comments feed for this article