0

The uploadFile is working fine in another page with similar code, so i refuse the configuration way.

I select a person to expand his asociated interview in another table, that i will show in another page. To make this, i redirect the page as:

<p:commandLink id="btnIrNtr" action="path/page.xtml?faces-redirect=true"
               actionListener="#{usuarioBean
                                     .getUsuarioTabla(obj.codPersona, false)}" >
                  <h:graphicImage value="#{msj.imgEntrevista}" 
                                  styleClass="imgCentro"/>
</p:commandLink>

This is the code inside my page:

 // more code
<p:dialog id="dlgImgNtr" header="#{msj.tImgNtr}" widgetVar="wdgImgNtr"
             closable="false" resizable="false" appendTo="@(body)">
      <h:form id="formImgNtr" enctype="multipart/form-data">
         <p:panel id="panelImgNtr">
            <p:fileUpload mode="simple" value="#{entrevistaBean.auxNtr.archivo}"
                          styleClass="marginTop10" id="fuEditarImgNtr">
               <f:validator validatorId="#{msj.urlValidatorArchivo}"/>
            </p:fileUpload>
            <p:outputLabel id="opObservImg" value="#{msj.fObservacion}" />
            <p:inputTextarea id="ipObservImg" maxlength="500" 
                             value="#{entrevistaBean.auxNtr.observacionesImg}"
                             autoResize="false" styleClass="width100" />

            <h:panelGrid id="btnInfImgNtr" styleClass="marginTop10" columns="2">
               <p:commandButton id="btnImgNtr" value="#{msj.btnGuardar}"
                                process="@this"
                                action="#{entrevistaBean.editarNtr}" 
                                ajax="false" />
               <p:commandButton id="btnImgNtrCerrar" value="#{msj.btnCancelar}"
                          actionListener="#{entrevistaBean.reset('formImgNtr')}"
                                oncomplete="cerrarComponente('wdgImgNtr')"
                                immediate="true" />
            </h:panelGrid>
         </p:panel> 
      </h:form>
   </p:dialog>

If I delete the fileUpload component and the type in the form, it works fine.

I think that the problem could be located when the pages reload and how it make the upload file, any idea will be wellcome!

AFC
  • 1
  • 1
  • Are you nesting forms? I.e. one `` inside another ``. – BalusC Aug 27 '15 at 13:24
  • Hello, BallusC. no i`m not nesting forms. – AFC Aug 27 '15 at 14:31
  • Another clue is the action listener or validator are not fired when commandButton is pushed – AFC Aug 27 '15 at 14:33
  • Just debug HTTP traffic and decode. See also bottom of http://stackoverflow.com/questions/8875818/how-to-use-primefaces-pfileupload-listener-method-is-never-invoked – BalusC Aug 27 '15 at 16:15
  • Hello! Finally i discover my fail. It was a configuration error. It's neccessary set the url where we're going to use the file upload. In my case this is the solution: Primefaces FileUpload Filter Faces Servlet /usuario/* /tratamiento/* – AFC Aug 27 '15 at 17:11

0 Answers0