Monday, January 7, 2013

how to preload the result of an RPC call on the initial loading page

I have an gwt app that needs some initial data during load. I'd like to minimize the http calls the app makes, and this initial data is user specific, but doesn't change very much per user (imagine user preferences). 

I want to preload the result of the call onto the page (but i don't want a large difference in the code that uses this data). I recall there was something in GWT that allowed the client side to read a string that contained the RPC serialized response and decode it into the corresponding object, as though you called the remoteService directly. But now i cannot find the method. The closest i found is com.google.gwt.user.server.rpc.RPC#encodeResponseForSuccess, and this is only for serverside (i would render the result of that call in the servlet onto the page as say, a javascript global variable, but there doesn't seem to be an easy way to decode it on the client side). 

Any pointers or help is greatly appreciated!

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

No comments:

Post a Comment