3 Replies Latest reply on Jan 9, 2009 10:42 AM by francof

    Thank you for rich:editor and a simple fileupload question

      Richfaces team,

      Thank you for the new rich:editor component. It worked like a charm and made life so simple.
      I have used it in another J2EE application and love it. Good choice :)


      I have a simple question on rich:fileupload

      I have

      <rich:fileUpload id="upload" acceptedTypes="jpg, gif, png, bmp" maxFilesQuantity="1"
      fileUploadListener="#{itemHome.processImageUpload}"
      autoclear="true" addControlLabel="Browse"
      reRender="itemImage" >
      


      The upload works fine. However after a user uploads an image, the add button is disabled. I set autoclear to true, but that only clears the uploaded image. How do I get the control to return to it's initial state with the add control enabled - to allow the user to change the image if he uploaded an incorrect one the first time ?

      Thanks guys

      Franco





        • 1. Re: Thank you for rich:editor and a simple fileupload questi

          Hello Franco ,

          You should rerender fileupload to return it to initial state if file max uploaded quantity has been reached.
          You can use events for this purpose (onuploadcomplete, onerror, onclear & etc);

          The another solution is set up very big value in 'maxFilesQuantity' attribute to avoid ADD button disabling after each file uploaded.

          • 2. Re: Thank you for rich:editor and a simple fileupload questi
            ilya_shaikovsky

            check the demo example.. there only 5 files could be uploaded. and the button which clears the data - resets the upload. You could do the same in the events that Andrey mentioned.

            We've decided that developers will need the point in the component to restrict the files count to be uploaded in real applications and will not allow to upload any count of files in genera cases.

            • 3. Re: Thank you for rich:editor and a simple fileupload questi

              Thank you both very much for your replies.

              I promise to look more closely in future at the example application code before posting for help.

              BTW, taking about that, I do like that new components are now flagged with a New icon.

              Best regards
              Franco