1 Reply Latest reply on Oct 25, 2010 6:32 AM by ilya_shaikovsky

    Tab icon keeps refreshing after using rich:fileUpload

    lenyas66

      I have noticed some strange behaviour, when I use rich:fileUpload component. After I upload the file and process it in my code, icon on IE tab keeps refreshing as if processing is still continues.

       

      Could anybody advise what could be done to prevent it?

       

      I attached the code below.

       

      Front end.

       

      <

      h:panelGroup>

       

      <rich:fileUpload fileUploadListener="#{piCopyPerformanceBean.fileListener}"

       

      id="upload" allowFlash="auto" addControlLabel="Browse"

       

      immediateUpload="true" listHeight="0px" listWidth="180px"

       

      styleClass="noBorders"

       

      acceptedTypes="csv, txt">

       

      <a4j:support event="onuploadcomplete" reRender="upload" ajaxSingle="true" />

       

      </rich:fileUpload>

       

      </h:panelGroup>

       

      ...

       

      Supporting bean.

       

      public

       

       

      final UploadItem item = event.getUploadItem();

       

      final Vector<String> acctCodes = new Vector<String>();

       

      if (item.isTempFile()) {

       

      final File file = item.getFile();

       

      final BufferedReader br = new BufferedReader( new FileReader(file));

      String line;

       

      while (( line = br.readLine()) != null){

       

      LOG.info(line);

      acctCodes.add(line);

      }

       

      LOG.info("Absolute Path : '" + file.getAbsolutePath() + "'!");

      file.delete();

      }

      else {

       

      final byte[] data = item.getData();

       

      final String accts = new String(data);

       

      LOG.error("NOT IMPLEMENTED");

       

      LOG.info(accts);

      }

       

      final List<String> lst102Accounts = accountManager.get102Accounts();

       

      for (final String acctCode : acctCodes) {

      copyCOMProdPerf(acctCode, lst102Accounts.contains(acctCode.trim()));

      }

      }

      void fileListener(UploadEvent event) throws Exception {