FileUpload 3.0M1 Rendered Bug

UI Components for JSF
Post Reply
denebj
Posts: 4
Joined: 18 Apr 2011, 17:43

21 Apr 2011, 18:36

Hello folks :) :)

I have an issue with the FileUpload (3.0 M1).
It is worling like it suppose to BUT, when I use the rendered attributes, it it not uploading files anymore !!

I have something like that :

Code: Select all


							<a4j:outputPanel id="uploadFile" rendered="-- Condition --">					
								<p:fileUpload 
									id="upload"
									mode="advanced" 
									rendered="true"
									label="Upload Studies"
									fileUploadListener="#{requestAdministration.uploadedFiles}" />
							</a4j:outputPanel>	

Depending on my condition I display the fileUpload or not . If I remove the rendered condition, it is working fine.

Thanks for looking into that !!

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 Apr 2011, 19:16

It is not a bug, you need to use a wider scope like viewscope, probably rendered resolves to false in fileupload request so JSF does not process it.

denebj
Posts: 4
Joined: 18 Apr 2011, 17:43

21 Apr 2011, 21:19

I am already using a viewScoped ;)

harish.seipl
Posts: 21
Joined: 15 Dec 2010, 07:53

23 Apr 2011, 07:31

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.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests