检测多上传素面组件何时结束所有上传 [英] Detect when the multiupload primefaces componet ends all the uploads
本文介绍了检测多上传素面组件何时结束所有上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要使用jsf版本2.1 primefaces 5.1和tomcat 7.
I´m usig the jsf version 2.1 primefaces 5.1 and tomcat 7.
在所有上载成功地在多个上载组件中之后,我必须执行托管Bean方法,我使用了onComplete属性,但是在每次上载之后执行.所有文件上传完成后,我需要这样做. 如何识别?
I have to execute a managed bean method after the all the uploads has been succesfully in a multiple upload component, I used the onComplete atribute, but is executed after each upload. I need to do it after the all files upload was completed. How identify that?
提前感谢您的时间和回答
Thanks in advance for your time and answers
PD我将这个问题发布在了 1 论坛的质询中,但没有人回答.
PD I posted this question in the primefaces 1 forum but nobody answer.
推荐答案
这应该有效:
<p:fileUpload ... oncomplete="doSomething(this);" />
<p:remoteCommand name="rc" actionListener="#{bean.method}" />
和
<script>
function doSomething(fileupload) {
if (fileupload.files.length == 0) {
rc();
}
}
</script>
在豆子上:
public void method() {
// Do something here
}
这篇关于检测多上传素面组件何时结束所有上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文