【问题标题】:Icefaces (ace) FileEntry direct submit without a "h:commandbutton" for avoid double click on import buttonIcefaces (ace) FileEntry 直接提交不带“h:commandbutton”以避免双击导入按钮
【发布时间】:2014-11-26 14:44:43
【问题描述】:
如何避免在使用 ace:fileEntry 时双击 Import 按钮?
-----------------------------------
| ------------- | ----------
| C:\temp\test.csv | Browse... | | | Import | <------ Avoid dblclick
| ------------- | ----------
-----------------------------------
【问题讨论】:
标签:
file-upload
import
double-click
icefaces-3
【解决方案1】:
我正在寻找避免双击icefaces FileEntry 组件的导入按钮的解决方案。
我找到了一个简单的解决方案,唯一的要求是使用 jQuery。
片段代码:
<ace:fileEntry styleClass="PEFileEntry1Class" fileEntryListener="#{fileImportComponent.fileValidation}" />
<script type="text/javascript" language="javascript">
jQuery('.PEFileEntry1Class').change(function() {
jQuery('.iceFrm').submit();
});
</script>
说明:
Icefaces 组件没有标准事件(onclick、onchange 等),那么我可以使用 jQuery 添加我需要的事件。我添加了一个“onChange”事件,当这个事件被触发时,我直接调用我的公式的提交。
而已! :-)