PDA

View Full Version : Load a Grid(-Module) from a XML-String



Tom48
17 Aug 2009, 3:18 AM
Hello,

I need you help again. I like to load a gridmodel from a xml like in the example...

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, GWT.getModuleBaseURL()+ xmlDataName);
HttpProxy proxy = new HttpProxy(builder);

// need a loader, proxy, and reader
XmlLoadResultReader<ListLoadResult<ModelData>> reader =
new XmlLoadResultReader<ListLoadResult<ModelData>>(getModelType());
BaseListLoader<ListLoadResult<ModelData>> loader =
new BaseListLoader<ListLoadResult<ModelData>>(proxy, reader);So I am not working with a local file anymore, which worked fine. I receive the same data as a string from a RCP. So how can I fill the model with the data from the xml-structured string.

I hope that anybody could help me.
Thank you all for doing the support in this forum!!!

Tom

Tom48
18 Aug 2009, 12:46 AM
Has anybody a idea how load a xml-string into a grid or how do I have to convert that string???

Kalle1985
9 Sep 2010, 10:05 AM
I have the same problem...what could be the solution?
What return-type is needed to retrieve a compatible result for the grid (XmlLoadResultReader)?

sven
9 Sep 2010, 10:07 AM
What exactly is the same problem? What problem do you have exactly?

Hakkert
8 Nov 2010, 2:35 AM
Same problem here. Sven what he means is now he uses a file on the server to fill the store. What he wants is to fille the store with the same xml but the xml is a string retrieved from an RPC call. So the question is how do you fill a store with an XML string (local or from RPC)

sven
8 Nov 2010, 3:20 AM
You can simple use the XmlReader with the RPC proxy together. You can match the reader/proxies as needed.

Hakkert
8 Nov 2010, 3:48 AM
Thanks for your response, but i think we would like an example for how to do this. If it was al this simple we wouldn't be asking these questions :)

sven
8 Nov 2010, 6:28 AM
There is an XML and a JSON grid example. Both use a HttpProxy. You can simple change it to a RPC proxy that returns a string and it still works exactly the same.