Bala:
I believe the reason is that forms that are not attached to the DOM tree or
are invisible to user are not submitted by the browsers. So that you have to
change your uploadForm to visible mode and attach it to the DOM tree.
- Avadh
On Fri, Dec 5, 2008 at 12:32 PM, Bala <[EMAIL PROTECTED]> wrote:
>
> I am trying to do a file upload from gwt-ext without bringing up the
> dialog box. To do this, I created a FormPanel and added the
> appropriate fields to it. Then did a form.submit(). This doesn't seem
> to work. Any idea why? The code is shown below.
>
> final FormPanel uploadForm = new FormPanel();
> uploadForm.setVisible(false);
> uploadForm.setFileUpload(true);
> final TextField sourceFile = new TextField("File", "sourceFile");
> sourceFile.setVisible(false);
> sourceFile.setInputType("file");
> sourceFile.setValue("/tmp/test.txt");
>
> final TextField targetFile = new TextField("Upload As", "targetFile");
> targetFile.setVisible(false);
> targetFile.setValue("different.txt");
>
> uploadForm.add(sourceFile);
> uploadForm.add(targetFile);
>
> final String url = GWT.getModuleBaseURL() + "/uploadFile";
> uploadForm.getForm().submit(url, null, Connection.POST, null, false);
>
> I tested the servlet on the server side with a simple html form and it
> works correctly. Only the GWT-EXT version doesn't seem to work.
>
> Thanks,
> Bala.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---