p:fileupload does not work on pe:layoutPane

Community Driven Extensions Project
Post Reply
pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

11 Jun 2012, 16:53

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

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Jun 2012, 16:57

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?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

11 Jun 2012, 23:13

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.

pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

11 Jun 2012, 23:14

It would be nice to get it working on pe:layoutpane though...

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

12 Jun 2012, 08:48

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?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

12 Jun 2012, 15:58

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>  
 

pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

12 Jun 2012, 15:59

I am using primefaces-extensions 0.4.0 because it supports <messages>
Primefaces 3.2
Mojarra
Glassfish

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

12 Jun 2012, 16:31

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
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

12 Jun 2012, 16:41

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.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

pacamajor
Posts: 9
Joined: 11 Jun 2012, 07:49

25 Jun 2012, 19:19


Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests