Because loadGeoNodeForm() is the function of GeoNodeController, so
that's why AsyncCallback.onSuccess() can't call it, all I want is to
call that function AFTER the RPC is done, how do I do that?

public class GeoNodeController {

    public void addNewNode(String theNewNodeParentId){
        service.addNewGeoNode(theNewNodeParentId, new AsyncCallback()
{

            public void onSuccess(Object result) {
                GeoNode tmp = (GeoNode)result;
                /********************** Put the loadGeoNodeForm
here????***********************/

            }
            public void onFailure(Throwable caught) {
                MessageBox.alert("Error in GeoNodeService.addNewNode
()" + caught.getStackTrace().toString() + "\n" + caught.getMessage() +
"\n");
            }
        });
        /********************** Or Should I Put the loadGeoNodeForm
here, If yes, how can I wait till the RPC is done beofore execute the
code??**********************/
    }

   public void loadGeoNodeForm(String nodeId) {
        service.getGeoNodeByNodeId(nodeId, new AsyncCallback() {

            public void onSuccess(Object result) {
                GeoNode theGeoNode = (GeoNode) result;
               /* do some loading */

            }

            public void onFailure(Throwable caught) {
                MessageBox.alert("Error in
GeoNodeService.getGeoNodeByNodeId()" + caught.getStackTrace().toString
() + "\n" + caught.getMessage() + "\n");
            }
        });
    }
}
On Jan 30, 3:33 pm, Ian Petersen <[email protected]> wrote:
> On Fri, Jan 30, 2009 at 12:26 PM,joeyoung<[email protected]> wrote:
> > 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????
>
> What do you mean by "loadGeoNodeForm() is a public class from
> GeoNodeController"?
>
> The approach you're already taking is the right approach so I don't
> understand what the compiler is preventing you from doing.  Maybe
> you've made a typo somewhere?
>
> Ian
--~--~---------~--~----~------------~-------~--~----~
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