简体   繁体   中英

How do you pass a 2d array from java to flex(using BlazeDs)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM