4 Replies Latest reply on Oct 20, 2008 6:26 AM by ameo

    ScrollableDataTable exception

    antony.mandilas Newbie

      Dear all,

      after i upgrade the library to version 3.2.2 when ever i try to click on a row or make any other action like sorting i get the following exception:

      java.lang.ArrayIndexOutOfBoundsException: 3
      org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.doDecode(ScrollableDataTableBaseRenderer.java:651)
      org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
      javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
      org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1159)
      org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168)
      org.richfaces.component.UIScrollableDataTable.processDecodes(UIScrollableDataTable.java:140)
      javax.faces.component.UIForm.processDecodes(UIForm.java:209)
      javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
      javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
      javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
      javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
      org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392)
      org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
      org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
      com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)


      my code is the following:


      <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px" width="620px"
      id="availableGroups" rows="40"
      value="#{UserGroupsBB.activeGroups}" var="group" sortMode="single"
      binding="#{UserGroupsBB.table}"
      selection="#{UserGroupsBB.selection}">

      <a4j:support event="onRowClick" action="#{UserGroupsBB.takeSelectionAction}"
      reRender="updateUserGroupCommand, createNewUserGroup"/>

      <rich:column id="groupId" width="200px">
      <f:facet name="header"><h:outputText styleClass="headerText" value="#{messages.groupId}"/></f:facet>
      <h:outputText value="#{group.groupId}"/>
      </rich:column>
      <rich:column id="groupName" width="200px">
      <f:facet name="header"><h:outputText styleClass="headerText" value="#{messages.groupName}"/></f:facet>
      <h:outputText value="#{group.groupName}"/>
      </rich:column>
      <rich:column id="dateAdded" width="100px">
      <f:facet name="header">
      <h:outputText styleClass="headerText" value="#{messages.dateadded}"/>
      </f:facet>
      <h:outputText value="#{group.dateAdded}">
      <f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
      </h:outputText>
      </rich:column>
      <rich:column id="active">
      <f:facet name="header"><h:outputText styleClass="headerText" value="#{messages.active}"/></f:facet>
      <h:outputText value="#{group.active}"/>
      </rich:column>
      </rich:scrollableDataTable>

      if i remove the a4j:support then the table operates fine. But i need it so that when a row is click some other parts of the page to be rerendered. I don't know if i could do it with some other way. But for sure this was working on version 3.2.1 with no exception.

      Kind regards,
      Antony

        • 1. Re: ScrollableDataTable exception
          Konstantin Mishin Novice

          I cannot reproduce this problem. Would you give more information. Also you can try to use event "onselectionchange" and/or to place a4j:support after columns.

          • 2. Re: ScrollableDataTable exception
            antony.mandilas Newbie

            Initialy the a4j:support was after columns, i moved it there trying to find what is going on.

            What more information would you like me to supply?

            Regards,
            Antony

            • 3. Re: ScrollableDataTable exception
              Konstantin Mishin Novice

              Attach war or eclipse project (better), please.

              • 4. Re: ScrollableDataTable exception
                ameo Novice

                I have the same problem.

                JBoss-Portal 2.6.5
                Richfaces 3.2.2.GA

                <f:view xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:rich="http://richfaces.org/rich">
                
                 <a4j:region>
                 <h:form>
                
                 <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="2"
                 height="250px" width="315px" id="sc1" rows="10"
                 columnClasses="cols"
                 selection="#{bean.selection}"
                 value="#{bean.sList}" var="item" sortMode="single">
                
                 <rich:column id="c1">
                 <f:facet name="header">
                 <h:outputText styleClass="headerText" value="#bean.label1}">
                 </h:outputText>
                 </f:facet>
                 <h:outputText value="#{item.name}" />
                 </rich:column>
                
                 ....some more columns
                
                 <a4j:support event="onRowClick"
                 actionListener="#{bean.selectionclick}"
                 reRender="cars" immediate="true">
                 </a4j:support>
                
                 </rich:scrollableDataTable>
                
                 </h:form>
                 </a4j:region>
                </f:view>
                


                faces-config.xml

                
                ..bean..
                
                <application>
                 <view-handler>
                 org.jboss.portletbridge.application.PortletViewHandler
                 </view-handler>
                </application>
                <factory>
                 <faces-context-factory>
                 org.jboss.portletbridge.context.FacesContextFactoryImpl
                 </faces-context-factory>
                </factory>
                ...
                



                web.xml

                <?xml version="1.0"?>
                <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                 version="2.4">
                
                 <context-param>
                 <param-name>facelets.DEVELOPMENT</param-name>
                 <param-value>false</param-value>
                 </context-param>
                 <context-param>
                 <param-name>facelets.SKIP_COMMENTS</param-name>
                 <param-value>true</param-value>
                 </context-param>
                 <context-param>
                 <param-name>facelets.VIEW_MAPPINGS</param-name>
                 <param-value>*.xhtml</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                 <param-value>
                 org.jboss.portletbridge.application.FaceletPortletViewHandler
                 </param-value>
                 </context-param>
                 <context-param>
                 <param-name>javax.portlet.faces.renderPolicy</param-name>
                 <param-value>ALWAYS_DELEGATE</param-value>
                 </context-param>
                 <context-param>
                 <param-name>
                 javax.portlet.faces.preserveActionParams
                 </param-name>
                 <param-value>true</param-value>
                 </context-param>
                
                 <filter>
                 <display-name>Ajax4jsf Filter</display-name>
                 <filter-name>ajax4jsf</filter-name>
                 <filter-class>org.ajax4jsf.Filter</filter-class>
                 </filter>
                
                 <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <servlet-name>FacesServlet</servlet-name>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                 </filter-mapping>
                
                 <context-param>
                 <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                 <param-value>server</param-value>
                 </context-param>
                 <listener>
                 <listener-class>
                 com.sun.faces.config.ConfigureListener
                 </listener-class>
                 </listener>
                 <servlet>
                 <servlet-name>FacesServlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
                 </servlet>
                 <servlet-mapping>
                 <servlet-name>FacesServlet</servlet-name>
                 <url-pattern>/faces/*</url-pattern>
                 </servlet-mapping>
                
                </web-app>
                



                EXCEPTION

                12:24:59,462 ERROR [BaseXMLFilter] Exception in the filter chain
                javax.servlet.ServletException: java.lang.ArrayIndexOutOfBoundsException: 3
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                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)