You have to setup your "change of screen" code to listen for the
onSuccess method inside you're AsynCallback.

For example


saveButton.addClickHandler(new ClickHandler(){

public void onClick(ClickEvent event){


       someAsyncService.save(createObjectToSave(), new
AsyncCallback<ObjectSavedToDatabase>(){

            public void onSuccess(ObjectSavedToDatabase savedObject){
 ///Now do your screen change logic
}
             public void onFailure(Throwable throwable){
                 //handle exception
}
      });


}

}




On Oct 18, 5:33 pm, Frédéric <[email protected]> wrote:
> Hello everybody....
>
> I need your help.
>
> Before to insert values in a database I have to check if some values
> are not in the DB.
> So I have to count the number of time this value appears in the DB.
>
> If the number of value is greater than 0, I am supposed to stay on the
> same screen.... But as we work in an asynchrone system GWT does not
> wait for the RPC response. So it goes on the next screen without
> waiting for the asynchronous result. (and the value who shall not be
> inserted in the DB is inserted).
>
> So is there someone with an idea to resolve my problem?
>
> Regards

-- 
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.

Reply via email to