Uploading with single button on ui.

Hi. I use the sixth version of Vaadin and I can’t find the solution of my problem: how can I make a button open browsers file chooser dialog and then upload selected file? There is Upload Component, but it consists of some other components (label, input, browse button and so on), and it’s not what I need.


It’s fortunately very simple, though not very intuitive perhaps. Just call upload.setImmediate(true);

See the demo on Sampler (check the “Immediate” checkbox from the “Edit Sample” popout menu in the top right":

Thanks a lot! I didn’t expect that it is so simple!