-
17 Mar 2009 12:00 AM #1
[FIXED] Multipart form submit; how to get raw response data
[FIXED] Multipart form submit; how to get raw response data
Hi, using a multipart form (for uploading a file) the server response is written to a hidden iframe in the FileUploadField. With a listener and Events.Submit a callback can be registered to catch the response data but it is presented as resultHtml.
What if I want the raw data returned from the server, e.g. because the servlet handling the file upload returns an XML containing a status response as well as an identifier to the uploaded data. The resultHTML property in the FormEvent contains HTML elements which are not in my response (and are probably added by the browser) in order to display but the iframe is hidden.
I noticed several things:
* In firefox the data (my response XML) is loaded the to iframe (using Firebug) to inspect, but the FormEvent.resultHTML is null.
* IE triggers the FormEvent several times and the resultHTML is changed (other HTML elements as span and div are added).
How can I get the RAW data?
Gr. Chris
-
17 Mar 2009 1:37 AM #2
It seems I can't get a response as XML. I now get HTML and parse the contents which seem to work in all browsers...
-
14 Jul 2009 1:44 AM #3
I have the same problem. Is there a solution?
I use Ext GWT 2.0.
-
10 Aug 2009 1:07 PM #4
I have the same problem. how can I get the response?
-
21 Jan 2010 11:30 AM #5
Set the mime type to "text/plain". With "text/html" and "text/xml" IE alters the text as it is embedded in the body of the iframe. I was able to retrieve the text and parse it:
Code:addListener(Events.Submit, new Listener<FormEvent>() { public void handleEvent(FormEvent be) { String xml = be.getResultHtml(); Document doc = XMLParser.parse(xml); Info.display("Action", "Size: " + doc.getFirstChild().getFirstChild().getNodeValue()); } });


Reply With Quote