Page 1 of 1

p:fileupload does not work on pe:layoutPane

Posted: 11 Jun 2012, 16:53
by pacamajor
File Upload widget of any kind (PrimeFaces, ICEFaces, etc) does not work when it is on top of a PE LayoutPane
FileUpload widget needs to be enclosed in a form of enctype="multipart/form-data"

However, when running, the form enctype is rendered as:

form enctype="application/x-www-form-urlencoded" action=".../myPage.jsf" method="post" name="mainForm" id="mainForm">

If I chance the enctype manually using firefox, it seems to work.

Please advise,
Thanks

Re: p:fileupload does not work on pe:layoutPane

Posted: 11 Jun 2012, 16:57
by Oleg
I could not understand what has pe:layout to do with h:form? These are two different components. Have you tested your code with p:layout? What is your code at all?

Again - If FileUpload widget needs to be enclosed in a form of enctype="multipart/form-data", simple do it :-) What is the problem?

Re: p:fileupload does not work on pe:layoutPane

Posted: 11 Jun 2012, 23:13
by pacamajor
I tried it with p:layout and it works!

When I use pe:layoutpane, the enctype of h:form gets overriden for some reason.

I tried copying the generic fileupload simple from Primefaces into a p:layout and it works, but if I copy the same into a pe:layoutpane, it doesn't.

Re: p:fileupload does not work on pe:layoutPane

Posted: 11 Jun 2012, 23:14
by pacamajor
It would be nice to get it working on pe:layoutpane though...

Re: p:fileupload does not work on pe:layoutPane

Posted: 12 Jun 2012, 08:48
by Oleg
Can you post your XHTML code please? I need to see what you do. I guess you use h:form like the pe:layout example in GettingStarted, right?

Re: p:fileupload does not work on pe:layoutPane

Posted: 12 Jun 2012, 15:58
by pacamajor

Code: Select all

<h:panelGroup id="layoutsContainer">   
  
    <h:panelGrid id="layoutsGrid" columns="2" style="margin-top: 15px;" cellpadding="0" cellspacing="0">  

        <pe:layout fullPage="false" style="width:450px; height:220px;"  
                   rendered="#{layoutController.layoutOneShown}" state="#{layoutController.stateOne}">  

            <pe:layoutPane position="west" size="150" minSize="40" maxSize="300">  
                Left  
            </pe:layoutPane>  

            <pe:layoutPane position="center">  
				<h:form enctype="multipart/form-data">  
				  
				    <p:messages showDetail="true"/>  
				  
				    <p:fileUpload value="#{fileUploadController.file}" mode="simple"/>  
				  
				    <p:commandButton value="Submit" ajax="false" actionListener="#{fileUploadController.upload}"/>  
				  
				</h:form>  
            </pe:layoutPane>  

        </pe:layout>  
  
    </h:panelGrid>  
</h:panelGroup>  
 

Re: p:fileupload does not work on pe:layoutPane

Posted: 12 Jun 2012, 15:59
by pacamajor
I am using primefaces-extensions 0.4.0 because it supports <messages>
Primefaces 3.2
Mojarra
Glassfish

Re: p:fileupload does not work on pe:layoutPane

Posted: 12 Jun 2012, 16:31
by Oleg
I am using primefaces-extensions 0.4.0 because it supports <messages>
Messages functionality was moved to core PrimeFaces, by the way. Read this please http://blog.primefaces.org/?p=1894

Re: p:fileupload does not work on pe:layoutPane

Posted: 12 Jun 2012, 16:41
by Oleg
I can't see any wrong usage of pe:layoutPane with h:form inside. Do you mean it works with p:layout and with PF Extensions enctype="multipart/form-data" is not rendered. Right? If so, please create an issue ticket here http://code.google.com/p/primefaces-ext ... ssues/list and point to this forum post. Thanks.

Re: p:fileupload does not work on pe:layoutPane

Posted: 25 Jun 2012, 19:19
by pacamajor