To date I have only managed to pass primitive types and Arrays to flex.
I need to know how to pass more complex objects like 2D arrays, or lists?
Are these sent in the same manner? and if so how are they unpackaged and displayed in say a datagrid?
I have searched for a long time for some 开发者_运维问答help on this but cant find anything.
Any help will be greatly appreciated!
Thanks
You do not have to do anything special...all the rules related to serialization can be found here. As you can read, the instances of java.util.Collection are going to be serialized to ArrayCollection, and the array to Array. For practice just create a bunch of methods returning whatever you want and on the Flex side inspect the event.result object.
The question about how to display the data into a datagrid is a little bit too general - You need a structure with 2 dimension or a list of complex objects for sure. If you take a look on the BlazeDS samples folder you will find some examples doing that.
精彩评论