Re: FormPanel.SubmitCompleteHandler called even on error return?

2011-02-11 Thread Thomas Broyer

On Friday, February 11, 2011 3:05:50 AM UTC+1, Bill Janssen wrote:

 I find that even when my server sends back 400 and 401 error responses 
 in response to a FormPanel submit, the SubmitCompleteHandler of the 
 FormPanel is still being called.


Of course, a web page is still sent to the client and displayed in the 
hidden iframe used by the FormPanel.
 

 Is there any way in a 
 SubmitCompleteHandler to see if the submit actually succeeded or not?


Look at the SubmitCompleteEvent's getResults and infer the result 
(success/failure) from it. In other words, your server should return 
something parsable, so you can be sure it's successful; and if you cannot 
parse it, then it's likely an error.
But honestly, if you can avoid using FormPanel, do it! I'd even say use 
Flash for file uploads if that's your use case (use plupload or gwt-upload 
if you can, to avoid dealing yourself with FormPanel)

-- 
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 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



FormPanel.SubmitCompleteHandler called even on error return?

2011-02-10 Thread Bill Janssen
I find that even when my server sends back 400 and 401 error responses
in response to a FormPanel submit, the SubmitCompleteHandler of the
FormPanel is still being called.  Is there any way in a
SubmitCompleteHandler to see if the submit actually succeeded or not?
This is with GWT 2.1.1.

-- 
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 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.