6 Replies Latest reply on Apr 8, 2010 11:42 AM by Ilya Shaikovsky

    rich:fileUpload disabled

    Krishna Kishore Novice

      Hi,

      I am using <rich:fileUpload ...> control.but when the page is loaded for the first time, "Add" button is disabled. It is getting enabled when the page is refreshed.

       

      I have used the tag in this way :

      <pre>

      <a4j:outputPanel id="unsubList_1">

      <rich:fileUpload id="unsubList" acceptedTypes="txt" required="true" requiredMessage="Please select a txt file to upload" maxFilesQuantity="1" fileUploadListener="#{bean.uploadListener}" listHeight="50px;' allowFlash="true" immediateUpload="true" autoclear="false">

         <a4j:support ajaxSingle="true" event="onclear" reRender="unsubList_1"/>

      </a4j:outputPanel>

      </pre>

       

       

      Please help me in this issue.

        • 1. Re: rich:fileUpload disabled
          Ilya Shaikovsky Master

          maxFilesQuantity="1" means that only one file could be uploaded and then addition will be disabled. To check how it works with EL binding to control overal amount of uploads visit or download richfaces-demo. But

          but when the page is loaded for the first time, "Add" button is disabled.

          should not occurs if maxFilesQuantity defined with 1 value. Looks like some initialization problem. Any js errors? Do you usnig flash? And what about richfaces version?

          • 2. Re: rich:fileUpload disabled
            Krishna Kishore Novice

            Its true that maxFilesQuantity="1" means "Add" button will be disabled after uploading a single file. But it is not the case here. The button is being disabled when the page is loaded itself.

             

            Yes I am using the attribute allowFlash="true"

             

            Previously I didn't use the attribute, allowFlash="true", at that time the button is enabled. But I am not able to see the uploaded files. So I added this attribute.

             

            No I did not come across any js errors.

             

            And regarding the version of Rich Faces I am using 3.3.2 (previously it is 3.3.1)

            • 3. Re: rich:fileUpload disabled
              Ilya Shaikovsky Master

              1) please try under 3.3.3CR1

              2) which Flash plugin version installed?

              • 4. Re: rich:fileUpload disabled
                Ilya Shaikovsky Master
                But I am not able to see the uploaded files. So I added this attribute.

                that's not a solution.. the problem should be investigated separatelly, in general behavior would be the same for flash and html modes. just transfer mechanism differs, but the problems looks in processing upload in listener.

                • 5. Re: rich:fileUpload disabled
                  Krishna Kishore Novice

                  As you said I tried with Rich Faces version 3.3.3 also, but no use. Still the "Add" button in fileUpload control is being disabled on the first go.

                   

                  Version of the Flash Player is 10.

                   

                  Might be the problem with the listener code.

                  Below is my code for fileUploadListener :

                   

                  public void fileUploadListener(UploadEvent uploadEvent){

                       UploadItem uploadItem = uploadEvent.getUploadItem();

                       File uploadedFile = uploadItem.getFile();

                       System.out.println("uploaded File : "+uploadedFile.getAbsolutePath());

                  }

                   

                  Is there anything additional process to be done in listener code?

                  • 6. Re: rich:fileUpload disabled
                    Ilya Shaikovsky Master

                    https://jira.jboss.org/jira/browse/RF-8341

                     

                    seems you need to turn off the flash plugin until that resolved.