2 Replies Latest reply on Mar 14, 2008 9:34 PM by nbelaevski

    How to bind the richface components

    alexrozario

      Hai everyone

      This is my project environment
      Jboss Seam 2.0.1 GA
      Rich face 3.1.4 GA
      I have a problem with component binding
      I try to bind rich:datascroller component
      I try with following code

      This is xhtml code

      <rich:datascroller ajaxSingle="false" for="prodList" maxPages="10" binding="#{productsearch.dataScroller}"/>

      And my backing bean code is
      Stateful
      @Name("productsearch")
      public class ProductsAction implements ProductsLocal,Serializable
      {
       org.richfaces.component.UIDatascroller dataScroller;
      
       public UIDatascroller getDataScroller() {
       System.out.println("Getter"+dataScroller);
       return dataScroller;
       }
      
       public void setDataScroller(UIDatascroller dataScroller) { System.out.println(this.dataScroller+"Settter"+dataScroller);
       this.dataScroller = dataScroller;
       }
      }
      

      When I try to visit this page the rich datascorller component invoke the getter method of the my bean class. But dataScroller bean class is not instantiated at the moment.
      Then I got the Exception like this
      16:00:30,812 ERROR [STDERR] Feb 16, 2008 4:00:30 PM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/ProductTableList.xhtml]
      javax.faces.FacesException: javax.el.ELException: /ProductTableList.xhtml @568,152 binding="#{productsearch.dataScroller}": java.lang.IllegalArgumentException: argument type mismatch
       at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:240)
       at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:327)
       at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:224)
       at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:139)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
      

      How to solve this problem
      Any help

      By
      Alex