Upload as a Form Field

How can I use an Upload as a normal Field of a Form, just like in HTML?
The Upload should not have an additional Button, but get uploaded when the user submits the Form.
There could be several Uploads in the same Form, all activated by submitting the Form.

Thanks for any help!

Hi!

There ain’t such an API for Upload atm. We’d need to have server side API Upload.submit() and possibility to hide the submit button (setButtonCaption(null)).

Generally I don’t see that kind of usage any good for end user. Actually strict wire frames is the only reason (and I know sometimes that is enough :slight_smile: ) I would use upload in such a way with Vaadin. I’d always use the immediate mode. This way the end user saves some precious time when he clicks on the “Save” button at the bottom of the page. The server already has received the file content at least partially and the other data is probably very quickly sent.

Check out EasyUploads addon in the Directory. Its UploadField component might be a perfect match for your requirements.

cheers,
matti