Hi, Thanks alot for your reply. I tried the same scenario with the latest version of GWT and the same result!!
I also tried to cancel the request in the window close listener. But, this is not the solution as it seems that the callback is invoked first (or in a separate thread). In the callback, in case of errors, I display a MessageBox with the error message to the user. This is fine in the normal situation but when I am leaving the page it is weired that a MessageBox appears then the page is refreshed! The only hope is to find a way inside the callback to know that I am leaving the page! and as a result disable the MessageBox. any idea? On May 18, 11:51 am, David <[email protected]> wrote: > Hi, > > Since you are new to GWT, any reason why you are using a version that > is 2 major releases behind ? > I don't remember by heart but, is it stated anywhere that moving to > another page will abort the requests automatically ? > > I don't think so, since GWT main focus is on single page applications. > > So you might want to listen to a window close event and abort the > request yourself. > > David > > > > On Mon, May 18, 2009 at 10:02 AM, Rasha <[email protected]> wrote: > > > Hi everyone, > > > I am new to GWT and currently working with GWT 1.4.61. To let my > > widgets communicate with the server I use com.google.gwt.http.client > > package. > > > Here is my code > > RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url); > > RequestCallback callback = new RequestCallback() { > > > // handle any error > > public void onError(com.google.gwt.http.client.Request > > request, Throwable e) { > > // Handle error > > } > > > // handle successful server response > > public void onResponseReceived > > (com.google.gwt.http.client.Request request, Response response) { > > // Handle response > > } > > }; > > builder.sendRequest(null, callback); > > > Test scenario > > ========== > > send a request and while waiting for response I leave to another page > > (i.e. before the response returns, I can do this by setting a break > > point hanging the server code) > > > I am facing strange behavior with firefox. > > > FireFox2 > > ====== > > The onError is called with the following exception > > java.lang.RuntimeException: Unable to read XmlHttpRequest.status; > > likely causes are a networking error or bad cross-domain request. > > Please seehttps://bugzilla.mozilla.org/show_bug.cgi?id=238559for > > more details > > > FireFox3 > > ====== > > The onResponseReceived is called with response status = 0. > > > Expected > > ======== > > I expect that the callback method is never called in such a case which > > i think happens in IE. > > > Any idea why the callback method is called? > > > Feedback would be highly appreciated.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
