3 Replies Latest reply on Aug 21, 2008 2:07 PM by baileyby

    fileUpload in modal panel does not work

    pdpantages

      Hello Forum,

      I am using:
      Jboss 4.2.2.GA
      Seam 2.0.1.GA
      Richfaces 3.2.1.GA

      I am using the rich:fileUpload to upload some attachemts.

      The fileUploadListener is defined in a Seam component,
      "neEditor", which is a Stateful component in CONVERSATION scope.

      Without the modal panel, this fileUpload works perfectly:

       <rich:fileUpload
       fileUploadListener="#{neEditor.fileUploadListener}"
       maxFilesQuantity="5"
       immediateUpload="false">
       <a4j:support event="onuploadcomplete" reRender="mainPanel4" />
       </rich:fileUpload>
      


      However, putting it in a modal panel, like so does not.

      <rich:modalPanel id="attup"
       autosized="true"
       onmaskclick="javascript:Richfaces.hideModalPanel('attup')">
       <h:form>
       <rich:fileUpload
       fileUploadListener="#{neEditor.fileUploadListener}"
       maxFilesQuantity="5"
       immediateUpload="false">
       <a4j:support event="onuploadcomplete" reRender="mainPanel4" />
       </rich:fileUpload>
       </h:form>
      </rich:modalPanel>
      


      The upload appears to complete, but the UploadItem upload presented to
      the listener contains null values for bytes, filename and contentType.

      If I remove the h:form, the listner is not called.

      If anyone has any ideas plesae post ....

      I will post this to the seam forum also.

      Thanks, PdP


        • 1. Re: fileUpload in modal panel does not work

          Hello,

          I tested your page posted with Rf 3.2.1 GA & Seam 2.0.
          It works fine. But my bean without definition of scope and state.

          May be problem caused by bean's settings.

          • 2. Re: fileUpload in modal panel does not work
            baileyby

            Okay, I apologize. I just stumbled across another post that mentioned the use of a modalPanel in the mix. I did not have a form element INSIDE my modal panel, but rather it was outside. Once I moved the modalpanel outside of the form tag, and then added a form as a child of it, the listener is working (see quick example below). But, I still have the IE "two click" issue if anyone has some hints.

            BAD:

            <h:form id="form1">
            <rich:modalPanel>
            <rich:fileUpload/>
            </rich:modalPanel>
            </h:form>
            


            GOOD:
            <h:form id="form1">
            </h:form>
            <rich:modalPanel>
            <h:form id="form2">
            <rich:fileUpload/>
            </h:form>
            </rich:modalPanel>
            


            Thanks, Byron

            • 3. Re: fileUpload in modal panel does not work
              baileyby

              Deleted message: appended to wrong topic