1

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. The link was helpful. For anyone else reading. I called the arrayList from java as normal: <s:RemoteObject id="getStockPrices" result="result(event)" destination="blazeDsService" endpoint="localhost:8400/flexspring/messagebroker/streamingamf"> then used: creationComplete="getStockPrices.getQuotes();" AND, dataProvider="{getStockPrices.getQuotes.lastResult}" On the datagrid. The problem I was having was that this would not display when I defined the columns of the grid. Once I took this out it worked.
Alternatively you can match the dataField attribute to an attribute in the array. <mx:columns> <mx:DataGridColumn headerText="Stock Ticker" dataField="name" /> <mx:DataGridColumn headerText="Price" dataField="price /> </mx:columns>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.