I am doing web application Project in GWT. I am using RPC, which is working fine.
I have 4 packeages
From .gui.loginpage
On onClick
method of a button I make a object of Login Class which is in client.control
onSuccess
of RPC public Boolean setConnection(true)
but when i try to getConnection
form .gui.loginpage
its show me null.
because the call back function is executed asynchronously, the function is invoked after the response comes to the browser from the server.
But the other part of the code is executed immediately by which time connection is still null
.
I need a solution or a method or any logic so that other function waits till the rpc call is complete.
It sounds like you are trying to use asynchronous communications synchronously. You must not process any thing else after you make the Async call. All logic you want to carry out post Async must go into the Async callback function, or another function that the Async callback calls. Just display a spinner and then finish up what you're doing on Async response.