Michael Wiles
Michael Wiles

Reputation: 21186

How to get a reference to elemental.html.FormData

I'm sure this is a simple problem... I am trying to use elementals FormData in gwt.

How do I get a reference to it? There is a JsFormData

public class JsFormData extends JsElementalMixinBase  implements FormData {
  protected JsFormData() {}

  public final native void append(String name, String value, String filename) /*-{
    this.append(name, value, filename);
  }-*/;
}

But this has a protected constructor... and I can't find any other reference to FormData...

Do I need to subclass this?

Upvotes: 0

Views: 107

Answers (1)

Ümit
Ümit

Reputation: 17489

Something like this should work:

public final native static JsFormData newJsFormData() /*-{
    return new $wnd.FormData();
}-*/;

and then you can simply call it

JsFormData formData = newJsFormData();

Upvotes: 1

Related Questions