0

The upload doesnt start automatic when i choose a file. Still need to upload it manual by clicking the upload-button.

<rich:fileUpload ....
        immediateUpload="true">

Is there a way to make this work? Im using richfaces 4.2.1.

user1338413
  • 2,471
  • 8
  • 29
  • 36

1 Answers1

2
  1. First copy the fileupload.js in to your application and add the same in your page like below:

    <script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/fileupload.js"></script>
    
  2. Second go to fileUpload.js and find a function called __updateButtons and update the first if which is checking the items length with the this.__startUpload();

    like below.

    __updateButtons: function() {
    
    if (!this.loadableItem && this.list.children(".rf-fu-itm").size()) {
    
        if (this.items.length) {
    
            //this.uploadButton.css("display", "inline-block");
    
            this.__startUpload();// New - Added the immediate upload to work.
    
        } else {
    
ronalchn
  • 12,225
  • 10
  • 51
  • 61
lalith
  • 21
  • 2