I'm trying to resort my nodes of the tree and save the new sorting
into the database. I want to make sure the save is successful before
I move the node, o/w it will display alert.
public boolean doBeforeMoveNode(Tree tree, TreeNode
node, TreeNode oldParent, TreeNode newParent, int index) {
return simpleNTreePanel.moveQuestion
(node,oldParent,newParent,index);
}
In moveQuesiton(), i called RPC and it will return a Boolean so me
that if it is successful or not.
public boolean moveQuestion(TreeNode node, TreeNode oldParent,
TreeNode newParent, int index) {
service.resorting(theNode.getId(), "1", new AsyncCallback() {
public void onSuccess(Object result) {
Boolean result = (Boolean) result;
<!-- If result is true
moveQusetion() will return true and node will be moved;
otherwise
Window.alert("ERROR Moving failed");
and return false and it stop the node moving
-->
}
public void onFailure(Throwable caught) {
Window.alert("ERROR Moving failed");
}
});
}
How can moveQuestion() wait until the RPC return the result?? I don't
want to use wait() coz it might took forever or it only take in sec.
Sorry for the stupid question.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---