1 Reply Latest reply on Jul 22, 2016 5:51 AM by Michal Petrov

    Richface fileupload ajax event uploadcomplete not called if rendered attribute is used

    Markus Weiss Newbie

      Hi,

       

      I'm using richface 4.5.17 final with Payara (GlassFish) 4.1.1 and facing the following problem:

       

      If I include a rendered attribute in the fileupload component the uploadcomplete event is no longer called.

       

      Example where event is not called:

       

      <rich:fileUpload 
            fileUploadListener="#{richFileUploadBean.popupFileUploadListener}"
            id="fileUpload" maxFilesQuantity="1"
            maxRequestSize="5000000"
            rendered="#{!richFileUploadBean.popupUploadFinished}"
           >
           <a4j:ajax event="uploadcomplete" oncomplete="alert('fileupload completed')" />
      </rich:fileUpload>
      

       

      In this case I try to set the boolean popupUploadFinished to true in the listener once the file is uploaded and hide the fileUpload afterwards. The listener is called.

       

      Working example:

      <rich:fileUpload 
            fileUploadListener="#{richFileUploadBean.popupFileUploadListener}"
            id="fileUpload" maxFilesQuantity="1"
            maxRequestSize="5000000"
      
           >
           <a4j:ajax event="uploadcomplete" oncomplete="alert('fileupload completed')" />
      </rich:fileUpload>
      

       

      By removing the rendered attribute everything works fine and the alert is shown. The listener is still called.

       

      Even a workaround with a panelGroup surrounding the fileUpload where the rendered attribute is defined leads to the same behavior.

       

      Any ideas?

       

      Thanks

      Markus