You may have to do a deep copy of your arrays. For example, I had to
do a deep copy to get a copy of a window location parameter map:
private HashMap<String, List<String>> getParamMap() {
Map<String, List<String>> paramMap =
Window.Location.getParameterMap();
// Must make a deep copy of the paramMap else it
// won't serialize through the RPC layer.
HashMap<String, List<String>> map = new HashMap<String,
List<String>>();
Set<String> keys = paramMap.keySet();
for ( String key : keys ) {
List<String> values = paramMap.get(key);
ArrayList<String> alist = new ArrayList<String>();
for ( String value : values ) {
alist.add(value);
}
map.put(key, alist);
}
return map;
}
On Mar 24, 12:31 pm, "Daniel Kvasnicka jr."
<[email protected]> wrote:
> Hi guys,
>
> I'm using GWT and I have problem with sending nested ArrayLists
> through a RPC service. The data produced by the service look like
> this:
>
> ArrayList of objects of type A.
> every A has a (Array)List of B property
> every B has a (Array)List of C property
> that property contains ArrayList of C -- those are leaf objects
>
> I've made sure that on the server side, the object structure is
> produced correctly. However when I place a breakpoint into the
> onSuccess method of a callback that handles the response from the
> service call, I get the top-level ArrayList of A and thats all. Their
> properties are set (e.g. String props) but the ArrayList of B is full
> of NULLs. The rest of the data gets lost somewhere. What could be the
> problem?
>
> I'm using the spring4gwt library. But I know that when "return" of the
> service method is called, it returns the right data.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.