send other UI widget values along with file while file submit

29 views
Skip to first unread message

sreenivas

unread,
Nov 20, 2012, 4:48:52 AM11/20/12
to google-we...@googlegroups.com
Hi,

I have to send file to the server. Along with file i want to send UI control values such as value typed in text box in the same page etc., How can i send these parameters? Can anyone please help?

Thanks,
Sreenivas

Jens

unread,
Nov 20, 2012, 5:15:15 AM11/20/12
to google-we...@googlegroups.com
Copy them to hidden form fields (GWT has a class called "Hidden" for hidden form fields). On server side you could use Apache FileUpload to extract all the data from the request.

-- J.

sreenivas

unread,
Nov 20, 2012, 5:25:08 AM11/20/12
to google-we...@googlegroups.com
Thanks for your reply. But I am not getting exactly what to do as I am new to GWT. Can you please provide some sample code?

Thanks,
Sreenivas

Jens

unread,
Nov 20, 2012, 6:28:22 AM11/20/12
to google-we...@googlegroups.com
The JavaDoc of GWT's FormPanel contains a small example how to use forms in GWT.


For files you use FileUpload in your FormPanel and for data that the use should not see in your UI but that you want to send along with your file you use the Hidden widget in your FormPanel. Hidden widgets obviously have to be filled by you programmatically as they are hidden in the UI. 

Apache FileUpload (to parse the request on server) also contains a small example on its site:


-- J.

sreenivas

unread,
Nov 20, 2012, 8:35:05 AM11/20/12
to google-we...@googlegroups.com
Thank you very much. I got the point. You are very helpful.

-sreenivas
Reply all
Reply to author
Forward
0 new messages