2 Replies Latest reply on Jan 2, 2017 11:04 AM by jcavazos

    rich:fileUpload gets to 100%, does not re-render

    jcavazos

      To allow a user to upload a file, plus add some other information, I'm trying to place a rich:fileUpload tool next to some other inputs and allow the user to submit with a button that is enabled when everything is in place

       

      RichFaces 4.5.17.Final

      Seam 2.3

       

       

       

      <h:form enctype="multipart/form-data">

      <p>

           <rich:select value="#{pdfFormsBean.uploadingType}">

                <f:selectItems value="#{pdfFormsBean.allTypes()}"

                               var="uploadingType"

                               itemLabel="#{uploadingType.displayString}"

                               itemValue="#{uploadingType}"/>

                <a4j:ajax event="change" execute="@this" render="addForm"/>

           </rich:select>

           <rich:fileUpload id="uploadPdfForm"

                            acceptedTypes="pdf"

                            immediateUpload="true"

                            maxFilesQuantity="1"

                            fileUploadListener="#{pdfFormsBean.uploadPdfForm}">

                <s:conversationId/>

                <a4j:ajax event="uploadcomplete" execute="@none" render="addForm"/>

           </rich:fileUpload>

           <h:panelGroup id="addForm">

                <h:commandButton value="Add Form"

                                 disabled="#{pdfFormsBean.uploadingType == null || pdfFormsBean.uploadingFile == null}"

                                 action="#{pdfFormsBean.addPdfForm()}"/>

           </h:panelGroup>

      </p>

      </h:form>

       

       

      When using the file upload tool, the file does get uploaded to the backing bean correctly, but on the web page the upload tool gets to 100% and does nothing. It does not re-render anything

       

      screen.png

        • 1. Re: rich:fileUpload gets to 100%, does not re-render
          michpetrov

          Any errors in the console? You don't need to set the enctype (in fact it might be better to not change it) the files are uploaded via AJAX.

          1 of 1 people found this helpful
          • 2. Re: rich:fileUpload gets to 100%, does not re-render
            jcavazos

            You know, I thought I remember seeing no errors in the console, but I tried again and saw this:

             

            Uncaught TypeError: Cannot read property 'childNodes' of undefined

            jsf.ajax.response @ richfaces.js:729

            rf.queue.response @ richfaces-queue.js:480

            jsf.ajax.response @ richfaces-queue.js:72

            (anonymous function) @ fileupload.js:548

            proxy @ jquery.js:529

             

            I removed enctype from the form, and now it works!