问题
I´m usig the jsf version 2.1 primefaces 5.1 and tomcat 7.
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 I posted this question in the primefaces 1 forum but nobody answer.
回答1:
This should work:
<p:fileUpload ... oncomplete="doSomething(this);" />
<p:remoteCommand name="rc" actionListener="#{bean.method}" />
and
<script>
function doSomething(fileupload) {
if (fileupload.files.length == 0) {
rc();
}
}
</script>
On the bean:
public void method() {
// Do something here
}
来源:https://stackoverflow.com/questions/26551669/detect-when-the-multiupload-primefaces-componet-ends-all-the-uploads