Drag & Drop, Lists and [RemoteClass]
September 24, 2009
The scenario:
- List 1: DragEnabled = true;
- List 1: DataProvider contains custom classes: MyClass (these classes do not extend any other class)
- List 2: DropEnabled = true;
The problem:
When I dragged the item from List 1 to List 2, the MyClass item was converted to an Object. As I wanted to display different ItemRenderers based on the class I needed the items not to be converted to an Object.
The solution:
Using the [RemoteClass] MetaData the class isn’t being converted to Object but remains MyClass.
From the Flex Reference Library:
Use the [RemoteClass] metadata tag to register the class with Flex so that Flex preserves type information when a class instance is serialized by using Action Message Format (AMF). You insert the [RemoteClass] metadata tag before an ActionScript class definition.
Advertisement
Like this:
Be the first to like this post.
No comments yet