1 Reply Latest reply on Jun 9, 2009 12:21 PM by Ilya Shaikovsky

    fileupload :: listener never called

    Cyril Gervais Newbie

      Dear all,

      I am facing an issue by using the rich:fileupload component. I have the following behaviours :
      - the defined listener is NEVER called
      - even if I set the listener to a random string (a method that does not exist) I have no error

      I use Seam and Richface 3.3.0.GA.

      So I give you my code :
      the component in my page:

      <h:form>
      ...
      <rich:fileUpload id="imageChooser" fileUploadListener="#{siteContent.listener}" (and here even with a method that does not exist I have no error for instance : #{xyz.xyz}) acceptedTypes="gif,jpg,png" maxFilesQuantity="1" immediateUpload="true">
      
      <a4j:support event="onuploadcomplete" oncomplete='Seam.Remoting.getContext().setConversationId( #{conversation.id} );Seam.Component.getInstance("targetHome").defineImageValueForProperty("#{block.name}", "#{prop.name}" , #{rich:component("imageChooser")}.entries[0].fileName)' />
      
       </rich:fileUpload>


      my listener (I focus on the listener method) :
      public void listener(UploadEvent event) throws IOException {
       System.err.println("************************************************");
      
      }


      And of course I redefined my web.xml :
      ?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       version="2.5">
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       <init-param>
       <param-name>createTempFiles</param-name>
       <param-value>true</param-value>
       </init-param>
       <init-param>
       <param-name>maxRequestSize</param-name>
       <param-value>200000</param-value>
       </init-param>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>


      I lost my all day with that problem and I really don't know what to do except asking for help... DO I have something more to look at ?
      I alos try to use the uploadData attribute but this attribute is never filled also...

      Thanks for your help.