Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form enctype="multipart/form-data">
<h:panelGrid columns="2">
<h:outputLabel value="File1"/>
<p:fileUpload id="file1" fileUploadListener="#{fileuploadBean.listenFile1}" auto="true" />
<h:outputLabel value="File2"/>
<p:fileUpload id="file2" fileUploadListener="#{fileuploadBean.listenFile2}" auto="true" />
<h:outputLabel value="File3"/>
<p:fileUpload id="file3" fileUploadListener="#{fileuploadBean.listenFile3}" auto="true" />
</h:panelGrid>
</h:form>
</h:body>
</html>
Code: Select all
public class FileUploadBean {
public void listenFile1(FileUploadEvent event) {
System.out.println("listening for file1");
}
public void listenFile2(FileUploadEvent event) {
System.out.println("listening for file2");
}
public void listenFile3(FileUploadEvent event) {
System.out.println("listening for file3");
}
}
Not sure, what is wrong, any help in resolving this issue is greatly appreciated.
It worked in 3.0.M2.
Doesnot work in 3.0.M4 and 3.0.RC2-SNAPSHOT. Unable to test it with 3.0.RC1 because of the issue 3042
Primefaces Version: 3.0.M4, 3.0.RC2-SNAPSHOT
JSF Version: 2.0.4-b09
Server Tomcat: 6.0.29