Saturday, February 18, 2017

Re: Browser.getWindow().newXMLHttpRequest()

Pretty old thread, but... to fix the "is not a function" error you need to add the GWT compiler param "-generateJsInteropExports".

On Thursday, November 17, 2016 at 11:32:30 AM UTC+1, P.G.Taboada wrote:
Thanks, this is what I was missing. 
I tried to use elemental, but could neither find formdata nor append...

I am having troubles with the event listeners:

final XMLHttpRequest xhr = Browser.getWindow().newXMLHttpRequest();"POST", "/upload");
xhr.setOnprogress(evt -> GWT.log("" + evt));
xhr.setOnabort(evt -> GWT.log("" + evt));
xhr.setOnerror(evt -> GWT.log("" + evt));
xhr.setOnreadystatechange(evt -> {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
try {
GWT.log("Received http response for request ");
String text = xhr.getResponseText();
if (text == null || text.isEmpty()) {
messageUi.setInnerText("no response");
} else {
} catch (Throwable e) {
GWT.log("Error", e);
final JsFormData formData = createFormData();
append(formData, "someFile", file);

I get 4 times Uncaught TypeError: this$static_0_g$.handleEvent is not a function

Any idea?

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment