GWT: FileUpload Browse Button styling

2019-08-15 04:02发布

I need to style the browse button of file upload in GWT.... I found the way through this link http://www.dreamincode.net/forums/topic/15621-styling-a-file-browse-button/. But I am not able to use the same in GWT. Any idea how to go about it?.

I am using GWT 2.4.0

3条回答
smile是对你的礼貌
3楼-- · 2019-08-15 04:58

There is already a Proper Solution here

File Upload Control and GWT Look and Feel

But i think you can try the following. This helped me to overcome the fault.

http://www.quirksmode.org/dom/inputfile.html

OR

http://www.kavoir.com/2009/02/styling-file-upload-select-input-control-input-typefile.html

查看更多
再贱就再见
4楼-- · 2019-08-15 05:00

I tried the following approach and it worked for me.

I hid the file upload field and used a trigger box on the screen instead. Trigger box click is delegated back to file upload browse button click using JSNI approach

private static native void fileClick (Element el) /*-{

             el.click();

 }*-/;

And used the fileupload.getfilename() and set the trigger text box with file location details.

查看更多
登录 后发表回答