3 Replies Latest reply on Jan 7, 2010 12:33 AM by user1234

    Rich:fileupload - how to use the onClean() event?

    bitec

      Hi.

       

      There is the 'fileUploadListener' - but there is no 'fileCleanListener' in "fileUpload". So (I implemented the list of files as shown in demo - the local List<File> in the bean and the fileUploadListener method, in which I add the just uploaded file to the list), how can I remove the uploaded file from the list on server, when I push "clean" button for the file in the fileUploader list? There is the onClean="" event, but I don't know, how to get the cleaned file on the server bean method.

       

      Thank you.

        • 1. Re: Rich:fileupload - how to use the onClean() event?

          As per my understanding you want to do a server side action in onClean() event where you want to remove the uploaded file from the list on server, then a create a a4j:commandButton with a action method binding and onClean() event you click that a4j:CommandButton by javascript if you want to go server on onClear() event.

          The fileUploadListener is for when you upload the files and from here you will get the currenly uploaded files list.

          Unless you will upload, there will not be any loadload file list and onClear() is just a client side method which is getting fired when browsed files is getting clear and in this stage the file is not upload yet in the server and not added in your uploaded file list.

          rich:fileUpload is for uploading the files to server, not to remove file from server.

          • 2. Re: Rich:fileupload - how to use the onClean() event?
            ilya_shaikovsky
            Deb Dutta, it's even better to suggest to use just a4j:support on onclean in order not to use invisible buttons and javascript
            • 3. Re: Rich:fileupload - how to use the onClean() event?
              Yes Ilya..you are absolutly right ..