Hi,
Your question is a bit ambiguous. So I answer to both understanding :
1/ if you talk about locking (synchronized)
The browser do not use several thread for executing the Javascript.
Then you do not have problem of synchronization.
Simply use a local variables to remember which calls are finished.
2/ if you want to do a synchronous call to the server
With GWT all calls to a service on server are asynchronous. Therefore
to do a task after the end of call you have to write the code in the
callback. Therefore your code is split in two parts :
private void m1() {
// first part of code
...
// call to the server
MyService.Util.getInstance().myRemoteMethod("hello world", new
AsyncCallBack() {
public void onSuccess(Object result) {
//second part of the code executed only after the remote
call
}
public void onFailure(Throwable problem) {
//second part of the code executed only after the remote
call
}
} );
//in most case do nothing here because you do not know when it is
executed with regards to the
} //end of m1
The code corresponding to the onSuccess (or onFailure) can also be
written into a separated method in order to the readability of your
code. Your code is therefore divided in two method. I advice you to
read the GWT doc :
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.RemoteProcedureCalls.html
Regards,
Seb
On Apr 24, 10:45 am, "oualaa hani" <
oualaa....@gmail.com> wrote:
> Hi,
>
> Please I want know how cn do synchronous call
>
> Thank you.