0 Replies Latest reply on Nov 25, 2009 3:46 PM by null null

    dataScrollerTable not working with ajax selection

    null null Novice

      I have the following code...

       <rich:scrollableDataTable frozenColCount="1" height="100px"
       width="700px" id="listTable" rows="#{queryManager.resultsPerPage}"
       value="#{queryManager.dataModel}" var="tpvTrans"
       sortMode="single"
       reRender="datascroller,callData"
       selection="#{queryManager.selection}"
       selectionMode="single">
      
       <a:support event="onselectionchange" reRender="callData">
       </a:support>
      
       <c:forEach var="col" items="#{queryManager.columns}">
       <rich:column rendered="#{queryManager.cellRendered[col]}">
       <f:facet name="header">
       <s:div>
       #{col.label}
       </s:div>
       </f:facet>
       <h:outputText escape="false" value="#{tpvTrans.getValue(col)}" />
       </rich:column>
       </c:forEach>
      
       </rich:scrollableDataTable>
      


      At first, I tried without the a:support thinking selection would cause an ajax request to set the selection on the server....appears that doesn't happen though. Once I add a:support though, I am getting a weird exception of


      Caused by javax.faces.convert.ConverterException with message: "Value 1234567890123456 is not supported by this converter"
      org.richfaces.convert.rowkey.ScrollableDataTableRowKeyConverter.getAsString(ScrollableDataTableRowKeyConverter.java:65)
      org.ajax4jsf.component.UIDataAdaptor.getClientId(UIDataAdaptor.java:715)
      javax.faces.component.UIComponent.getContainerClientId(UIComponent.java:363)
      javax.faces.component.UIComponentBase.getClientId(UIComponentBase.java:279)
      org.ajax4jsf.renderkit.AjaxCommandRendererBase.isSubmitted(AjaxCommandRendererBase.java:127)
      org.ajax4jsf.renderkit.AjaxCommandRendererBase.doDecode(AjaxCommandRendererBase.java:54)


      As a user selects rows, I am trying to rerender another pane much like you would do in outlook, click and email and the other pane shows the email. The 1234567890123456 is the pk of my FIRST entity, not the selected entity. I am not sure why. I am using a backing ExtendedDataModel bean as well. It all works great until I add the a:support and things start failing....I can page with data scroller and I can select except it is not applied on server. how do I fix this?

      My java code from setSelection is

       public void setSelection(SimpleSelection selection) {
       this.selection = selection;
       Iterator<Object> iterator = selection.getKeys();
       SimpleRowKey key = (SimpleRowKey) iterator.next();
       tpvTrans = dataModel.getCachedItems().get(key.intValue());
       }
      
      
      any ideas here?