I' m trying to create a simple Button and when it's clicked I want to trigger a hidden FileUpload widget which is inside a FormPanel. What I have done until now is two things:
Can anyone help me please??? I have searched a lot but I find nothing working.
myFileUpload.getElement().<InputElement>cast().click()
is what you're looking for.
For it to work in WebKit-based browsers (Chrome, Safari), the FileUpload has to be "moved out of view" but not hidden (as in setVisible(false), which sets the CSS display property to none), i.e. something like (in CSS): position:absolute; top: -1000px; left: -1000px;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With