3 Replies Latest reply on Mar 6, 2013 7:14 AM by vanna mount

    How to get filename when clear event fired

    Federico Martinez Newbie

      Hi all,


         I'm developping with JSF 2.1.6 Mojarra and RichFaces 4.1.0 Final. When a user uploads many files and then click on CLEAR ALL button I'm able to delete the files, but if the user clicks on CLEAR link (next to a certain file) how can I get the file's name of the cleared object?


         I've read this and this thread but I don't manage to make it work. I'm not so experienced with this web-development stuff.


         Here's what I have


                          <rich:fileUpload addLabel="Agregar" clearAllLabel="Quitar todos"
                                           clearLabel="Quitar" deleteLabel="Quitar"
                                           doneLabel="Completado" uploadLabel="Subir archivos"
                                           acceptedTypes="txt, csv"
                              <a4j:ajax event="uploadcomplete" render="validationButton"/>
                          <a4j:jsFunction name="clearFunc" render="validationButton"
                                          actionListener="#{uploadBean.doClearFile}" >
                              <a4j:param name="filename"/>


      and the backing bean being


          public void doClearAllFiles(){
              validationButtonRendered = false;
          public void doClearFile(){
              //How to get file's deleted name???
              validationButtonRendered = false;


      Basically I want to execute doClearAllFiles if ClearAll clicked otherwise doClearFile if Clear link next to a file is clicked (deleting just that file).