GWT:FileUpload浏览按钮样式 [英] GWT: FileUpload Browse Button styling
问题描述
我需要在GWT中设置文件上传的浏览按钮....我通过这个链接找到了方法 http://www.dreamincode.net/forums/topic/15621-styling-a-file-browse-button/ 。但我不能在GWT中使用相同的。任何想法如何去做?。
我正在使用GWT 2.4.0
我尝试了下面的方法,它为我工作。
我隐藏了文件上传字段,并在屏幕上使用了一个触发器。触发器点击被委托回文件上传浏览按钮点击使用JSNI方法
pre $私有静态本地无效fileClick(Element el)/ * - {
el.click();
} * - /;
使用fileupload.getfilename()并设置触发器文本框中的文件位置详细信息。 p>
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
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.
这篇关于GWT:FileUpload浏览按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!