2 Replies Latest reply on Jul 9, 2008 4:37 AM by Andrei Markavtsov

    rich:fileUpload : Add 5 files: Click upload: Skips alternate

    Arun Prakash Newbie

      Using add button select 5 files.
      Click on upload.
      listener method system.out only prints files 1, 3, 5

      Is this bug?

      I am using following jars.
      richfaces-api-3.2.1-20080521.044424-46.jar
      richfaces-impl-3.2.1-20080521.044424-46.jar
      richfaces-ui-3.2.1-20080521.044424-30.jar

      JSF 1.2


      <h:form enctype="multipart/form-data">
      <rich:fileUpload fileUploadListener="#{bean.listener}"
      uploadData="#{bean.data}"
      maxFilesQuantity="#{bean.uploadsAvailable}" id="upload"
      immediateUpload="#{bean.autoUpload}"
      listWidth="550px" listHeight="100%"
      acceptedTypes="jpg, gif, png, bmp" autoclear="true">
      <a4j:support event="onuploadcomplete" reRender="info" />
      </rich:fileUpload>
      </h:form>

      maxFilesQuantity: 5



      bean method:

      public void listener(UploadEvent event) throws Exception {

      try {
      UploadItem item = event.getUploadItem();
      System.out.println("File : " + item.getFileName() + " was uploaded");
      uploadsAvailable--;

      } catch (Exception e) {
      e.printStackTrace();
      }

      }