Shi schrieb: > loginService.getIdProgrammer(fName.getValueAsString(), > fLastName.getValueAsString(), email.getValueAsString(), callback1 ); > > loginService.createUser(userNew.getValueAsString(),passwNew.getValueAsString(), > id_programmer, callback2);
[...] > final AsyncCallback callback1 = new AsyncCallback(){ > public void onSuccess(Object result) { > long ok = Long.valueOf(result.toString()).longValue(); > id_programmer = ok; RPC-calls are asynchron, so while the first call is still in progress, the second call will started immediately and does nothing special because the global variable is still set to the old value. After a while the first call returns and the callback is setting the global variable. A second click lead to the same behavior but because the global variable contains the retrieved value, the second call works. Instead of calling the second method inside the ButtonListener, call it in callback1. That way you can spare the use of global variables that are regarded bad style anyway ;-) Regards, Lothar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---