1 Reply Latest reply on May 30, 2012 2:41 AM by sadfaces

    Richfaces 4.2.2 HOW TO: set the fileuploadlistener?

    sadfaces Newbie

      Based on the 4.x show case, I have:




      <rich:fileUpload fileUploadListener="#{fsBean.uploadListener}"
                                                        <a4j:ajax event="uploadcomplete" execute="#{fsBean.doUpload()}" render="info" />




      public class FileServiceBean implements Serializable {
                private List<BpFile> files = new ArrayList<BpFile>();
                private IFileService iFileService;
                public void uploadListener(FileUploadEvent event) throws Exception {
                          // get the uploaded file from richfaces
                          UploadedFile item = event.getUploadedFile();
                          // create the BpFile
                          BpFile file = new BpFile();
              // add the file to upload list
                public void doUpload() {
                public void clearUploadData() {


      I ran this webapp in tomcat7, when I was trying to open the page, I got the following error:


      javax.el.PropertyNotFoundException: Property 'uploadListener' not found on type abc.xyz.FileServiceBean


      Any one here could help please, I am totally new to everything. Thanks heaps in advance.

        • 1. Re: Richfaces 4.2.2 HOW TO: set the fileuploadlistener?
          sadfaces Newbie

          ok, so what I have done to pass this exception for testing is super ugly. I added those lines to FileServiceBean:


          public void setListener(Object obj){}

          public Object getListener() {return new Object();}


          it now works as expected so far. I am not sure if there will be any potentially fatal defects by doing this.


          I hope anyone here can provide me a clean solution will be appreciated.