1 2 Previous Next 17 Replies Latest reply on Aug 15, 2013 6:03 AM by David Lee

    Problem with FileUpload RichFaces 4

    Ronan Silva Newbie

      Hi...

       

      The following code is not working:

      My .xhtml

      <rich:fileUpload fileUploadListener="#{managerBean.listener}" id="upload" acceptedTypes="gif">

                <a4j:ajax event="uploadcomplete" execute="@none" render="info" />

      </rich:fileUpload>

       

      My Class

       

      @SessionScoped

      @ManagedBean(name="managerBean")

      public class ManagerBean {

                 private ArrayList<UploadedImage> files = new ArrayList<UploadedImage>();

         public void listener(FileUploadEvent event){

                       UploadedFile item = event.getUploadedFile();

                       UploadedImage file = new UploadedImage();

                       file.setLength(item.getData().length);

                       file.setName(item.getName());

                       file.setData(item.getData());

                       files.add(file);

                }

                //Getter and Setter

      }

      The listener method is not being invoked!!!

       

      Something is missing or is bug??

       

      Thank's for Help

        1 2 Previous Next