Monday, April 20, 2015

Help Posting form with file input using elemental

I've been working on file uploading to AppEngine using the blob store. I would like to do so in the background using elemental (no suggestions for 3rd party libraries please.) I think I have it mostly figured out but I can't figure out the code to get the form data from the form element.

The java script should look like this:
                            var formElement = document.getElementById("formElementID");
                            var request = new XMLHttpRequest();
                  "POST", "urltopostto");
                            request.send(new FormData(formElement));

Here's my java code with elemental. The last line has the part I can't figure out.

                            FormElement formElement = (FormElement) Browser.getDocument().getElementById("uploadForm");
                            XMLHttpRequest request = Browser.getWindow().newXMLHttpRequest();

                  "POST", uploadUrl);
                            request.send(!!!NEED FORM DATA FROM MY FORM ELEMENT HERE!!!!);

General guidance on how to map JS to Elemental code would be great.


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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