wbstr / vaadin-multifileupload

12 stars 23 forks source link

Fire button click via code #9

Closed morridm-zz closed 10 years ago

morridm-zz commented 10 years ago

Is there a why to fire the button click via code/programmatically?

For example, MultiFileUpload multiUpload = new MultiFileUpload(this, uploadStateWindow); multiUpload.click();

Thanks!

David

juger89 commented 10 years ago

For security reasons you can't trigger the file browser dialog in javascript, unless it is as a response to some user triggered event. Anyway I have tried it in GWT with Gquery and native JS, by invoking click() on the file input element and while it works in Firefox and IE10, it won't work in Chrome, Safari and Opera (WebKit browsers).