Though I am a newbie, but this is what I understand from the details.
You need to do chainig...
You need to call the second function in the call back of the first..

Cheers,
Amit

On Tue, Oct 21, 2008 at 12:01 PM, Muhannad Ali <[EMAIL PROTECTED]>wrote:

> Hi,
>
> I'm working on GWT RPC and I have a problem with the method invocation
> order; I have to invoke two methods m1() and m2() by this order (cause
> m2 depends on the results of m1) but, I don't know why, the method
> m2() is invoked before m1() even if I wrote: m1(); m2();
>
> So, does RPC Asynchronous Callback implies that the methods could be
> invoked out of order? If so, please how could I workaround that?
>
> For more details, here is what I exactly do:
>
> public RPCServiceAsync rpcService;
> HashMap<Integer, ActiveCategory> active_cats;
>
> public void onModuleLoad() {
>     ...
>     load_categories();
>     load_objects(cat_id);
>     ...
> }
>
> private void load_categories(){
>  rpcService.getCategoryList(new AsyncCallback<HashMap<Integer,
> ActiveCategory>>(){
>        public void onFailure(Throwable caught) {
>        }
>
>        public void onSuccess(HashMap<Integer, ActiveCategory> result) {
>                active_cats = result;
>        }
>  });
> }
>
> private void load_objects(final int cat_id){
>  rpcService.getObjectList(cat_id, new
> AsyncCallback<ArrayList<Integer>>(){
>        public void onFailure(Throwable caught) {
>        }
>
>        public void onSuccess(ArrayList<Integer> result) {
>                ActiveCategory cat = active_cats.get(cat_id);
>                cat.set_active_objects(result);
>        }
>  });
> }
>
>
> ----------
>
> public class ActiveCategory implements IsSerializable{
>        private int cat_id;
>        private boolean displayed = false;
>        private ArrayList<Integer> active_objects = new
> ArrayList<Integer>();
> }
>
> ----------
>
> In this example, always the load_objects() is invoked before
> load_categories() !?? Please help!
>
>
>
>
> >
>


-- 
Warm Regards,
Amit Dhingra

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