0

I'm getting wrong or what, the same code for p:fileUpload works fine, but when I put p:fileUpload into p:dialog, it is not working.

<p:dialog id="confirmDialog"   appendToBody="true"
                   header="MAJ Fichier FMD"  widgetVar="confirmation">  
           <h:form enctype="multipart/form-data" >
           <h:panelGrid columns="1" cellpadding="5">
                     <p:fileUpload  
                     auto="true"                 
                     fileUploadListener="#{parserXls.handleFileUploadFMD()}"
                     sizeLimit="2097152"
                     label="Choose"
                     allowTypes="/(\.|\/)(pdf)$/"
                     description="Images"/>
                     <p:commandButton id="OK" value="OK" onclick="confirmation.hide()" type="button" /> 
                     </h:panelGrid> 
                </h:form>                  
        </p:dialog>  

What is the problem here?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Adriano_jvma
  • 455
  • 2
  • 11
  • 20

2 Answers2

2

The situation looks like a nested forms problem - if it is so, remove the inner form and try again.

dratewka
  • 2,104
  • 14
  • 15
1

Well i had the same problem and it wasn't nested forms problem. I was using action instead of actionListner.

For those who still have the problem, check if you not forget to put ( enctype="multipart/form-data") inside the form.

Ahmed Aziz
  • 380
  • 1
  • 5
  • 17