Hi,
I have an Anchor that onClick performs an RPC call to a servlet. Based on the outcome I want to set the hRef of the Anchor, and then perform the open url action of the Anchor.
BUT: how can I tell the anchor to wait for the Callback to finish before trying to open the url?
@UiField
Anchor anchor;
@UiHandler("anchor")
void onClick(ClickEvent evt) {
MyService.performRPC(jsonDTO, new MessageCallBack());
//delay here until callback finised and has set the hRef of anchor
}
class MessageCallBack implements AsyncCallback<String> {
@Override
public void onSuccess(String result) {
// do some computations based on the result and create the url thereby
String url =...
anchor.setHref(url);
}
}
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment