I am trying to use RPC calls for fetching data from the Server–>DB and then populate my client side widgets like ListBox, Grid etc. The problem is that since the calls are asynchronous, it cannot be guaranteed that the client side runtime will wait for the server calls to come back and then populate the widgets using the data from the callback result. Is there a way to do this?
regards,
J
By design, there is no way to make a synchronous request in GWT. You can, however refrain from showing the widgets (and perhaps display a spinner) until the data has returned from the server. A way to do this would be to make the widgets visible in a method that is called from the
AsyncCallbackyou used when getting the data from the server.An example follows (in practice, you’d probably do this at a form level, as opposed to a widget level, but you get the idea).