6 Replies Latest reply on Nov 5, 2008 1:07 PM by Ilya Shaikovsky

    maybe a bug in scrollableDataTable

    lee shaotu Newbie

      First,in the scrollableDataTable online demo,click the table header,the row selected performance will not work,so click "Show Current Selection" buttom will not show the current selection.

      But now,i have another problem.
      I use scrollableDataTable,when selection changes the data of the first selection will be show in the page.
      the strange thing is that i must scroll the scroll bar,then take selection,it will work fine.If not,the needed part will not be rerended,and java.lang.ArrayIndexOutOfBoundsException will be threw.

      page code:

      <h:form>
      <h:panelGrid>
      <h:outputText value="Files" />
      <rich:scrollableDataTable
      height="200px" width="800px" id="fileTable" rows="40"
      value="#{fileUpload.fileList}" var="files"
      binding="#{fileUpload.table}" selection="#{fileUpload.selection}">
       ......
      
      
      <rich:column width="600">
      <f:facet name="header"><h:outputText value="summary"/></f:facet>
      <h:outputText value="#{files.summary}" />
      </rich:column>
      <a4j:support event="onselectionchange" reRender="newSum"/>
      </rich:scrollableDataTable>
      </h:panelGrid>
      <h:panelGrid id="newSum">
      <h:outputText value="#{fileUpload.firstFile.name}"/>
      <h:inputTextarea cols="60" rows="5" value="#{fileUpload.firstFile.summary}"/>
      <a4j:commandButton value="changeSummary" action="#{fileUpload.changeSummary}" />
      <a4j:outputPanel ajaxRendered="true">
      <rich:messages style="color: #FF0000; size: 12px"/>
      </a4j:outputPanel>
      </h:panelGrid>
      </h:form>
      

      back bean:
      private SimpleSelection selection=new SimpleSelection();
      private UIScrollableDataTable table;
      private ArrayList<File> selectedFiles=new ArrayList<File>();
      private File firstFile=new File();
      
      ......
      
      public File getFirstFile() {
       this.takeSelection();
       if(selectedFiles.isEmpty()){
       firstFile.setName("");
       firstFile.setSummary("");
       return firstFile;
       }
       firstFile=selectedFiles.get(0);
       return firstFile;
       }
      
      
      
      public String takeSelection() {
       getSelectedFiles().clear();
      
       if (getSelection().isSelectAll()){
       getSelectedFiles().addAll(fileList);
       }
       else{
       Iterator<Object> iterator = getSelection().getKeys();
       while (iterator.hasNext()){
       Object key = iterator.next();
       table.setRowKey(key);
       if (table.isRowAvailable()) {
       getSelectedFiles().add((File)table.getRowData());
       }
       }
       }
       return null;
       }
      



        • 1. Re: maybe a bug in scrollableDataTable
          lee shaotu Newbie

          this won't happen in using extendedDataTable.

          • 2. Re: maybe a bug in scrollableDataTable
            Konstantin Mishin Novice

            Post your stacktrace, please.

            • 3. Re: maybe a bug in scrollableDataTable
              lee shaotu Newbie

              11:07:56,418 WARN [lifecycle] 3
              java.lang.ArrayIndexOutOfBoundsException: 3
              at org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.doDecode(ScrollableDataTableBaseRenderer.java:651)
              at org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
              at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1159)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168)
              at org.richfaces.component.UIScrollableDataTable.processDecodes(UIScrollableDataTable.java:140)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
              at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
              at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
              at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
              at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              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: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 edu.wanli.os.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              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:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
              11:07:56,418 ERROR [lifecycle] JSF1054: (Phase ID: APPLY_REQUEST_VALUES 2, View ID: /workspace/service/resource_m_select.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@67ad79]
              11:07:56,418 INFO [STDOUT] ERROR - Exception in the filter chain
              javax.servlet.ServletException: 3
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
              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: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 edu.wanli.os.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              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:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
              Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
              at org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.doDecode(ScrollableDataTableBaseRenderer.java:651)
              at org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
              at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1159)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168)
              at org.richfaces.component.UIScrollableDataTable.processDecodes(UIScrollableDataTable.java:140)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
              at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
              at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
              at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
              at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              ... 27 more
              11:07:56,418 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
              java.lang.ArrayIndexOutOfBoundsException: 3
              at org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.doDecode(ScrollableDataTableBaseRenderer.java:651)
              at org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
              at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1159)
              at org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168)
              at org.richfaces.component.UIScrollableDataTable.processDecodes(UIScrollableDataTable.java:140)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
              at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
              at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
              at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
              at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              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: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 edu.wanli.os.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              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:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)

              • 4. Re: maybe a bug in scrollableDataTable
                Konstantin Mishin Novice

                What version RichFaces are you using?

                • 6. Re: maybe a bug in scrollableDataTable
                  Ilya Shaikovsky Master

                  could you please just check 3.3.0-snapshot?