1 Reply Latest reply on Aug 21, 2008 2:07 PM by baileyby

    FileUpload issues in BETA4

    baileyby

      I'm trying to use the fileUpload component, somewhat unsuccessfully. I've searched through the defect list but haven't come across anything that rings a bell. Sorry if these are known issues. My JSF runtime is comprised of: myfaces 1.2.3, facelets 1.1.14, and richfaces 3.2.2 beta4.

      First, in IE 7.0.5730.13 the first time the "Add" button is clicked, nothing happens. I must then click it again to get the file selection dialog to display. Any subsequent clicks to Add (without a full refresh of the screen) only requires a single click. I'm not sure why I must click twice the first time, but it's not a problem in IE 6 or FF 3.

      Second, I cannot for the life of me get the fileUploadListener to get invoked. It worked successfully with an earlier version of richfaces using the Sun JSF RI. I've reduced my test case to simply have my listeners do a System.out.println() to no avail. Here's my code:

      ...
      <rich:fileUpload id="uploader"
       fileUploadListener="#{pc_ExcelImport.fileUploadListener}"
       acceptedTypes="xls"
       immediateUpload="true"
       maxFilesQuantity="999"
       progressLabel="{_KB}KB of {KB}KB
      uploaded">
      ...
      
      //from pc_ExcelImport bean
      public void fileUploadListener(UploadEvent event){
      System.out.println("upload event fired");
      }
      


      I know my managed bean configuration is correct because I am able to output simple bean properties using an h:outputText tag.

      Please advise, thanks.

        • 1. Re: FileUpload issues in BETA4
          baileyby

          Okay, I apologize. I just stumbled across another post that mentioned the use of a modalPanel in the mix. I did not have a form element INSIDE my modal panel, but rather it was outside. Once I moved the modalpanel outside of the form tag, and then added a form as a child of it, the listener is working (see quick example below). But, I still have the IE "two click" issue if anyone has some hints.

          BAD:
          Code:

          <h:form id="form1">
          <rich:modalPanel>
          <rich:fileUpload/>
          </rich:modalPanel>
          </h:form>



          GOOD:
          Code:

          <h:form id="form1">
          </h:form>
          <rich:modalPanel>
          <h:form id="form2">
          <rich:fileUpload/>
          </h:form>
          </rich:modalPanel>



          Thanks, Byron