5 Replies Latest reply on Nov 15, 2007 8:24 AM by Maksim Kaszynski

    scrollableDataTable can't sort column after select a row

    tang shengjie Newbie

      I would like to sort the column after select a row.
      An error after select a row.
      I have this:

      test.html:
      
      <a4j:form>
       <a4j:outputPanel id="sldt">
       <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px" width="700px" id="carList" rows="5"
      value="#{provinceForm.provinceList}" var="bean" sortMode="single">
       <rich:column id="provinceN" sortExpression="#{bean.provinceName}">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Province" /></f:facet>
       <h:outputText value="#{bean.provinceName}" />
       </rich:column>
       <rich:column id="areaN" sortExpression="#{bean.areaName}">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Area" /></f:facet>
       <h:outputText value="#{bean.areaName}" />
       </rich:column>
       <rich:column id="edit" sortable="false">
       <f:facet name="header"><rich:spacer width="6"/></f:facet>
       <img src="images/delett_L.gif" width="16" height="16" style="cursor:pointer"/>
       </rich:column>
       </rich:scrollableDataTable>
       </a4j:outputPanel>
      </a4j:form>
      


      ProvinceForm.java:
      
      public List getProvinceList() {
       List<ProvinceBean> list = new ArrayList<ProvinceBean>();
       ProvinceBean bean = new ProvinceBean();
       bean.setAreaName("South");
       bean.setProvinceName("SH");
       list.add(bean);
       ProvinceBean bean2 = new ProvinceBean();
       bean2.setAreaName("North");
       bean2.setProvinceName("BJ");
       list.add(bean2);
       return list;
      }
      



      error:
      
      Error Rendering View[/test.html]
      java.io.NotSerializableException: org.richfaces.model.selection.SelectionRange
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
       at java.util.ArrayList.writeObject(ArrayList.java:570)
       at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
       at java.util.HashMap.writeObject(HashMap.java:1001)
       at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
       at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:167)
       at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:382)
       at org.ajax4jsf.application.AjaxStateManager.writeState(AjaxStateManager.java:208)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:599)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       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:175)
       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:263)
       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
       at java.lang.Thread.run(Thread.java:619)
      



      I am use:
      jsf 1.1
      richfaces 3.1.2
      facelets 1.1.2

      Has something wrong in my code?how can I use it ?
      thanks !!!