GWT: FileUpload Browse Button styling

2019-08-15 04:56发布

问题:

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

回答1:

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.



回答2:

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



回答3:

http://raffidotnetlearner.blogspot.in/2014/02/change-browsechoose-text-in-aspnet.html

This Link Very Awesome it is working fine