File upload listener+ p:tab
Hey i had met with a strange problem. File upload lisener works fine when the file upload component is used in first tab(the second tab contains another form to display something else.).But when the file upload component is used in second tab (the first tab contains something to display with a separate form) the listener is not at all being called.
Primefaces version:3.0M1
Glass fish: 3.0
Jars used:Commons.fileupoad-1.2.2
Here is my xhtml code
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<title>Upload</title>
</h:head>
<h:body>
<p:tabView dynamic="true" id="Test"
widgetVar="Tabs">
<p:tab title="Tab08" id="Tab08">
<h:form id="uploadForm" prependId="false">
First tab
</h:form>
</p:tab>
<p:tab title="second">
<h:form id="secondform" prependId="false" enctype="multipart/form-data">
<p:growl id="messages" showDetail="true"/>
<p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
mode="advanced"
update="messages"
sizeLimit="1000000"
allowTypes="png,gif,jpg" />
</h:form>
</p:tab>
</p:tabView>
</h:body>
</html>
And here is my web .xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>none</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/Login.xhtml</welcome-file>
</welcome-file-list>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter </filter-class>
</filter>
<filter>
<filter-name>Character Encoding Filter</filter-name>
<filter-class>org.primefaces.examples.filter.CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Character Encoding Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
</web-app>
Please let me know what is my mistake. My demand is to use separate forms for every tabs.