2 Replies Latest reply on May 11, 2015 9:14 AM by barbaraboie

    Strange behaviour of rich:fileupload with maxFilesQuantity="1" in Internet Explorer

    barbaraboie

      Hello

      I noticed a strange behaviour of the fileuploader in Internet Explorer when the value of maxFilesQuantity is set to 1. I can add a file, but when I click on 'upload' nothing happens. When I click first somewhere else (for example on the background) and then on 'upload', then it does work. Does anyone know a solution? Or another way to limit the quantity to 1?

       

      Richfaces 4.5.2

      Internet Explorer 11

       

      Thanks in advance!

      barbara

        • 1. Re: Strange behaviour of rich:fileupload with maxFilesQuantity="1" in Internet Explorer
          michpetrov

          There seems to be a bug in IE 11, we've already had this reported (RF-13723) but I couldn't find any solution, for some reason the browser simply stops firing click events.

          • 2. Re: Strange behaviour of rich:fileupload with maxFilesQuantity="1" in Internet Explorer
            barbaraboie

            Hello Michal, thanks for your answer.

            I discovered that the uploadButton does work in IE if I put the opacity of the addButton to zero. You can still add documents if you click on the space where the addButton was, but you don't see the button anymore (that solution was good enough for us).

             

            in my template.xhtml:

            <h:outputScript target="head" library="javascript" name="test_richfaces.js" />

             

            In test_richfaces.js:

            jQuery.extend(RichFaces.ui.FileUpload.prototype, {

              __updateButtons : function() {

              if (!this.loadableItem && this.list.children(".rf-fu-itm").size()) {

              if (this.items.length) {

              this.uploadButton.css("display", "inline-block");

              this.addButton.css("opacity", "0");

              } else {

              this.uploadButton.hide();

              this.addButton.css("display", "inline-block");

              }

              } else {

              this.uploadButton.hide();

              this.addButton.css("display", "inline-block");

              }

              }

            });