Hi,
I always get into this problem, it will be great if someone tell me
how to do it in a popular way.
Sometimes I always want to do something after RPC calls and it came
back with data. In this case, i want to save a new node first, then I
want to load the node information to a form.
In GeoNodeController.java:
public void addNewNode(String theNewNodeParentId){
service.addNewGeoNode(theNewNodeParentId, new AsyncCallback()
{
public void onSuccess(Object result) {
GeoNode tmp = (GeoNode)result;
--------->>> loadGeoNodeForm();
}
public void onFailure(Throwable caught) {
MessageBox.alert("Error in GeoNodeService.addNewNode
()" + caught.getStackTrace().toString() + "\n" + caught.getMessage() +
"\n");
}
});
// <Do something here>
}
However loadGeoNodeForm() is a public class from GeoNodeController.
So the compiler won't let me do it, is it a possible way that I can
wait until the RPC is done, and finish the OnSuccess() function, then
it go back to addNewNode() 's <Do something here> area????
I know it is confusing, but I really want to know how I can do
something after RPC is down without putting them in OnSuccess() (Since
Onsuccess() can't access a lot of data that is outside of AsyncCallback
() )
Thank You so much and I hope you understand my problem =S
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---