4 Replies Latest reply on Oct 1, 2008 10:33 AM by Sascha Janz

    rich:fileupload not working

    Sascha Janz Master

      hi

      i use richfaces 3.2.2 with seam 2.0.2

      i got a simple test page with a file upload component


      <?xml version="1.0" encoding="ISO-8859-1"?>
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:s="http://jboss.com/products/seam/taglib">
      <link rel="stylesheet" type="text/css" href="resources/los_style.css" />
       <h:form id="upload" >
       <rich:fileUpload addControlLabel="Hinzufügen" maxFilesQuantity="5" fileUploadListener="#{Upload.listener}" cancelEntryControlLabel="Abbrechen" clearAllControlLabel="Alle löschen"></rich:fileUpload>
       </h:form>
      </ui:composition>
      


      the bean is

      package de.lorenz.soaworkflow.session;
      
      
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.richfaces.event.UploadEvent;
      import org.richfaces.model.UploadItem;
      
      
      @Name("Upload")
      @Scope(value = ScopeType.PAGE)
      
      public class UploadBean {
      
       private static int fileCount = 0;
      
       public void listener(UploadEvent event) throws Exception {
       fileCount++;
       UploadItem item = event.getUploadItem();
       System.out.println("File uploaded: " + item.getFileName() + " / " + item.getContentType() + " / " + item.getFile().length());
       }
      
       public int getSize() {
       System.out.println("Size: " + UploadBean.fileCount);
       return UploadBean.fileCount;
       }
      
      }
      


      when i click upload nothing happens....

      what is wrong?