2 Replies Latest reply on Jan 16, 2008 7:33 AM by daniel.soneira

    binding problems - please help

      I am not able to bind a richfaces control to a backing bean. When I do I always get

      16:25:04,799 ERROR [STDERR] Jan 10, 2008 4:25:04 PM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/caseDetail.xhtml]
      javax.faces.FacesException: javax.el.ELException: /caseDetail.xhtml @510,47 binding="#{caseManagement.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 org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:327)
       at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:224)
      .
      .
      .
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)
      Caused by: javax.el.ELException: /caseDetail.xhtml @510,47 binding="${caseManagement.datascroller}": java.lang.IllegalArgumentException: argument type mismatch
       at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:101)
       at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:237)
       ... 65 more
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
       at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
       at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
       at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
       at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
       at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
       at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
       ... 66 more
      

      I have tried binding a datascroller as well as a scrollabledatatable, and always get the same response. I am pretty confident that my code is correct. Here is an exampel with the datascroller

      xhtml
      .
      .<rich:datascroller
       id="lnScroller"
       align="left"
       for="lnList"
       maxPages="20"
       pageIndexVar="pageIndex" pagesVar="pages"
       binding="#{caseManagement.datascroller}">
       <f:facet name="pages">
       <h:outputText value="#{pageIndex} / #{pages}"></h:outputText>
       </f:facet>
       </rich:datascroller>
      

      bakcinbg bean
      private HtmlDatascroller datascroller;
      .
      .
      public HtmlDatascroller getDatascroller() {
       return datascroller;
       }
      
       public void setDatascroller(HtmlDatascroller datascroller) {
       this.datascroller = datascroller;
       }


      My only thought is that there is a problem with classloading - I am using Maven. Since I need richfaces-ui to compile the backing bean - since it references an org.richfaces.component.html.HtmlDatascroller, and we also need richfaces-ui in web-inf/lib - Where should my richfaces libraries go?
      I have an EAR project structure, so I am assuming that I put richfaces-impl and richfaces-ui in web-inf/lib, and richfaces-ui and richfaces-api in my EAR /lib directory. Is this correct? does anyone have a maven EAR project structure pom file for when you want to use binding in a backing bean? An ythoughts on this would be helpfull as I can not bind ANYTHING