I am working on a file upload (like everyone else), and created a few widgets for it, including a FormPanel. This might make it into Monday's release of my distribution. I welcome comments on the API.
The FormPanel's constructor takes a Panel as an argument. This panel is used to organize the widgets inside of the form.
public FormPanel (Panel panel);
public Panel getPanel ();
public void setEncodingType (String type);
public void setMultipartEncoding ();
public void setMethodAsGet ();
public void setMethodAsPost ();
public void setTarget (String url);
public boolean add (Widget widget);
public void submit ();
I also created a FileUpload class, that currently only has a constructor and no methods, The constructor takes the field name as it's only argument.
public FileUploadField (String name);
Here is a code example of using both classes:
final FormPanel form = new FormPanel(new FlowPanel());
FileUploadField fUpload = new FileUploadField("file");
Hyperlink addLink = new Hyperlink();
public void onClick (Widget sender)