You can't fire off an async request to the server and expect to be able to
use the result immediately.

Move the code you have after the RPC or RequestBuilder call into the
onSuccess method of the callback.

Ian

http://examples.roughian.com


2009/12/25 MaEcTPo <olegik...@gmail.com>

> I have a problem.
>
> I have a variable on my class:
> public ArrayList<HashMap<String,String>> statuses = new
> ArrayList<HashMap<String,String>>();
> and I have a method, which populates this variable from JSON.
>
> So, after populating I try to use it, but it is empty. But, If I use
> Window.alert("something") before, I'll receive in this variable what I
> want.
>
> For example, this part of code write to GWT.log:
>
> int statusesSize = statuses.size();
> GWT.log("statusesSize: " + statusesSize, null);
> Window.alert("" + statusesSize);
> int statusesSize2 = statuses.size();
> GWT.log("statusesSize2: " + statusesSize2, null);
>
> 12:58:25.541 [INFO] [mythirdgwt2] statusesSize: 0
> 12:58:49.864 [INFO] [mythirdgwt2] statusesSize2: 4
>
> Why it happens? How can I fix it?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to