7 Replies Latest reply on Jan 1, 2009 6:07 PM by nathan dennis

    scollableDateTable binding issues

    nathan dennis Expert

      im having trouble with the scrollable data table binding attribute.

      seam 2.1.0sp1
      richfaces snap 3.3.0 > 12/19
      jboss 4.2.2


      javax.el.ELException: /maintenance/include/lookup.xhtml @46,62 binding="#{phyEditAction.stable}": 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)
       ... 94 more
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       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)
       ... 95 more
      
      


      backin bean
      import org.richfaces.component.UIScrollableDataTable;
      import org.richfaces.model.selection.SimpleSelection;
      ........
      
      @Stateful
      @Name("phyEditAction")
      @Scope(ScopeType.CONVERSATION)
      public class PhyEditAction implements PhyEditLocal{
       private SimpleSelection selection = new SimpleSelection();
       private UIScrollableDataTable stable;
      
      ...........
      public SimpleSelection getSelection() {
       return selection;
       }
      
       public void setSelection(SimpleSelection selection) {
       this.selection = selection;
       }
       public String takeSelection() {
       this.phy = null;
       Iterator<Object> iterator = getSelection().getKeys();
       while (iterator.hasNext()){
       Object key = iterator.next();
       stable.setRowKey(key);
       if (stable.isRowAvailable() && this.phy ==null) {
       this.phy = ((Phy) stable.getRowData());
       }
       }
       selectPhy(null);
       return null;
       }
      
       public UIScrollableDataTable getStable() {
       return stable;
       }
      
       public void setStable(UIScrollableDataTable stable) {
       this.stable = stable;
       }

      there is also an interface for this bean.


       <rich:modalPanel id="lookupmp" autosized="false"
       height="400"
       width="320"
       top="20" style="padding:0px;height:">
       <f:facet name="header" style="height:20px;">
       <h:outputText value="#{messages['maintenance.phy.phylook.mptitle']}" />
       </f:facet>
      
       <f:facet name="controls">
       <h:graphicImage value="/img/error.gif"
       style="cursor:pointer;border:0px;"
       onclick="Richfaces.hideModalPanel('lookupmp');"/>
       </f:facet>
       <rich:panel style="text-align:left;">
       <s:div id="lookupcontainer" style="position:relative;top:0px;left:0px;">
       <s:div rendered="#{phyEditAction.phySearchsw}" style="padding:0px;z-index:300;">
       <h:form>
       <rich:scrollableDataTable
       frozenColCount="1" height="300px"
       width="300px"
       id="phyList"
       rows="20" columnClasses="colMnm,colName"
       value="#{phyEditAction.phySearchList}" var="p"
       first="0"
       rowKeyVar="rkv"
       binding="#{phyEditAction.stable}"
       selection="#{phyEditAction.selection}">
       <rich:column id="make">
       <f:facet name="header"><h:outputText styleClass="headerText"
       value="#{messages['maintenance.phy.label.phyMnm']}" /></f:facet>
       <h:outputText value="#{p.phyMnm}" />
       </rich:column>
       <rich:column id="model">
       <f:facet name="header"><h:outputText styleClass="headerText"
       value="#{messages['maintenance.phy.label.phyName']}" /></f:facet>
       <h:outputText value="#{p.phyName}" />
       </rich:column>
       </rich:scrollableDataTable>
       <br/>
       <a:commandButton value="Show Current Selection" reRender="mainpanel"
       action="#{phyEditAction.takeSelection}" >
       <s:conversationId/>
       <rich:componentControl for="lookupmp" operation="hide" event="oncomplete"/>
       </a:commandButton>
       </h:form>
       </s:div>
       </s:div>
       </rich:panel>
       </rich:modalPanel>
      


      i have read everything i could find in the doc.. got the example code out of the trunk.. im new to creating jsf components dynamically... i must be missing something. i even tried using a UIComponent as the backing because some something i read in the doc then casting it to the scrollable table.. didnt work.

      any help would be greatly appreciated.