2 Replies Latest reply on Nov 28, 2008 6:29 AM by Joerg Lehmann

    ajaxKeys in scrollableDataTable doesn't work

    Joerg Lehmann Newbie

      Hi,

      I get following error message, when I try to use the attribute 'ajaxKeys' of a scrollableDataTable:

      javax.faces.convert.ConverterException: Value 3 is not supported by this converter
       at org.richfaces.convert.rowkey.ScrollableDataTableRowKeyConverter.getAsString(ScrollableDataTableRowKeyConverter.java:45)
       at org.ajax4jsf.component.UIDataAdaptor.getClientId(UIDataAdaptor.java:715)
       at javax.faces.component.UIComponent.getContainerClientId(UIComponent.java:311)
       at javax.faces.component.UIComponentBase.getClientId(UIComponentBase.java:241)
       at org.ajax4jsf.component.UIDataAdaptor.restoreChildState(UIDataAdaptor.java:964)
       at org.ajax4jsf.component.UIDataAdaptor.restoreChildState(UIDataAdaptor.java:943)
       at org.ajax4jsf.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:361)
       at org.ajax4jsf.component.UIDataAdaptor$ComponentVisitor.process(UIDataAdaptor.java:95)
       at org.ajax4jsf.component.UIDataAdaptor.encodeAjaxChild(UIDataAdaptor.java:488)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:104)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
       at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
       at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
       at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:250)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
       at org.apache.myfaces.custom.ppr.PPRLifecycleWrapper.render(PPRLifecycleWrapper.java:84)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)


      On the page I'm using following code:

      <rich:scrollableDataTable id="test" height="200px" rowKeyVar="rowKey" rows="0" var="item" value="#{test.values}" ajaxKeys="#{test.ajaxKeys}">
       <rich:column id="col1">
       <f:facet name="header">col1</f:facet>
       <h:outputText id="out1" value="#{item[0]}"/>
       </rich:column>
       <rich:column id="col2">
       <f:facet name="header">col2</f:facet>
       <h:inputText id="in1" value="#{item[1]}">
       <a4j:support event="onchange" reRender="out2"/>
       </h:inputText>
       </rich:column>
       <rich:column id="col3">
       <f:facet name="header">col3</f:facet>
       <h:outputText id="out2" value="#{item[2]}"/>
       </rich:column>
      </rich:scrollableDataTable>
      


      and in the associated bean (which is in the session scope):

      public class MyTest {
      
       private ArrayList<ArrayList<String>> values;
       private Set<Integer> ajaxKeys;
      
       public MyTest ()
       {
       ajaxKeys = new HashSet<Integer>();
       ajaxKeys.add(3);
       }
      
       public Set<Integer> getAjaxKeys()
       {
       return ajaxKeys;
       }
      
       public ArrayList<ArrayList<String>> getValues()
       {
       if (values == null)
       {
       values = new ArrayList<ArrayList<String>>();
       for (int row = 0; row < 10; row++)
       {
       ArrayList<String> columns = new ArrayList<String>();
       values.add(columns);
       for (int col = 10; col < 20; col++)
       {
       columns.add("cell"+row+"/"+col);
       }
       }
       }
       return values;
       }
       ...
      


      If I use the code with a rich:dataTable or a rich:extendedDataTable it shows the expected behaviour (the 3. column in the 4. row is rerenderd) but with rich:scrollableDataTable the error occurs.

      Any ideas what I'm doing wrong?

      Thx in advance
      Joerg