title: How to reRender specific row in richfaces 4
body: <p>I am trying to reRender a specific row of a subtable within a datatable. I am using richfaces 4.2  final and jsf 2 running on JBoss AS 7.1 CR1b.  From what I could find there are 2 ways to reRender a row, either use @rows() or table:row, but I couldn't get either working. I'm not sure if its even possible to do it with a subTable, or how to do it.  </p>
  
  <p>The id's of the cells in the generated source look like this: <code>id="tableForm:timesheetTable:0:subTable:0:j_idt55"</code></p>
  
  <p>Here is my table code:</p>
  
  <pre><code>&lt;h:form id="tableForm" &gt;
      &lt;rich:dataTable var="day" value="#{timesheetHome.days}" id="timesheetTable" rowKeyVar="rowKey"&gt;
          &lt;f:facet name="header"&gt;
              &lt;rich:columnGroup&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Ticket Nbr" /&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Assigned By" /&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column style="width:60px;"&gt;
                      &lt;h:outputText value="Status" /&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Hours"/&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Description" /&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Details"/&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                      &lt;h:outputText value="Non-Billable"/&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                  &lt;/rich:column&gt;
                  &lt;rich:column&gt;
                  &lt;/rich:column&gt;
              &lt;/rich:columnGroup&gt;
          &lt;/f:facet&gt;
  
          &lt;rich:column colspan="10" style="background-color:#eee;"&gt;
              &lt;h:outputText value="#{day.name}"/&gt;
          &lt;/rich:column&gt;
  
  
          &lt;rich:collapsibleSubTable var="item" value="#{day.items}" rowKeyVar="rowNum" id="subTable"&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.ticketNumber}" /&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.reportTo}" /&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.status}"/&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.hours}" /&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.task}" /&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:outputText value="#{item.notes}" /&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;h:selectBooleanCheckbox value="#{item.nonBillable}" disabled="true"/&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;a:outputPanel&gt;
                      &lt;h:graphicImage value="/resources/img/check.png" onclick="completed(#{item.id});"/&gt;
                      &lt;rich:tooltip showDelay="500" value="Change Status" layout="block" followMouse="false" /&gt;
                  &lt;/a:outputPanel&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;a:outputPanel&gt;
                      &lt;h:graphicImage value="/resources/img/edit.png" onclick="edit(#{item.id},#{rowKey},#{rowNum});"/&gt;
                      &lt;rich:tooltip showDelay="500" value="Edit" layout="block" followMouse="false" /&gt;
                  &lt;/a:outputPanel&gt;
              &lt;/rich:column&gt;
              &lt;rich:column&gt;
                  &lt;a:outputPanel&gt;
                      &lt;h:graphicImage value="/resources/img/delete.png" onclick="remove(#{item.id});"/&gt;
                      &lt;rich:tooltip showDelay="500" value="Delete" layout="block" followMouse="false" /&gt;
                  &lt;/a:outputPanel&gt;
              &lt;/rich:column&gt;
  
          &lt;/rich:collapsibleSubTable&gt;
  
  
          &lt;f:facet name="footer"&gt;
          &lt;rich:columnGroup&gt;
              &lt;rich:column colspan="5"&gt;
                  &lt;h:outputText value="Total hours: "/&gt;
                  &lt;h:outputText value="#{timesheetHome.weekHours}"/&gt;
              &lt;/rich:column&gt;
              &lt;rich:column colspan="5"&gt;
                  &lt;h:outputText value="Billable hours: "/&gt;
                  &lt;h:outputText value="#{timesheetHome.weekBillableHours}"/&gt;
              &lt;/rich:column&gt;
          &lt;/rich:columnGroup&gt;
          &lt;/f:facet&gt;
      &lt;/rich:dataTable&gt;
      &lt;/h:form&gt;
  </code></pre>
  
  <p>and the button that is supposed to reRender the row:</p>
  
  <pre><code>&lt;a:commandButton id="update"
                        value="Update"
                       action="#{timesheetHome.update}" rendered="#{timesheetHome.managed}" render="timesheetTable:#{timesheetHome.rowKey}:subTable:#{timesheetHome.rowNum} notify" oncomplete="if (!#{timesheetHome.error}){#{rich:component('popup')}.hide();}"/&gt;
  </code></pre>
  
  <p>when the rowKey and rowNum are primitive type int, then nothing happens on the rerender.  If i change them to type Integer in the backing bean, I get the following error:</p>
  
  <pre><code> WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http--0.0.0.0-8080-5) String index out of range: 0: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  at java.lang.String.charAt(String.java:695) [:1.7.0_02]
  at org.richfaces.context.IdParser.parse(IdParser.java:120) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ComponentIdResolver.addIdImmediately(ComponentIdResolver.java:196) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ComponentIdResolver.addId(ComponentIdResolver.java:231) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.renderkit.util.CoreRendererUtils.findComponentsFor(CoreRendererUtils.java:137) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.RenderComponentCallback.doVisit(RenderComponentCallback.java:86) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ExecuteComponentCallback.doVisit(ExecuteComponentCallback.java:47) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ComponentCallback.visit(ComponentCallback.java:94) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:321) [richfaces-core-impl-4.2.0.Final.jar:]
  at javax.faces.component.UIComponent.visitTree(UIComponent.java:1589) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at javax.faces.component.UIForm.visitTree(UIForm.java:344) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at org.richfaces.context.ExtendedPartialViewContextImpl.visitActivatorComponent(ExtendedPartialViewContextImpl.java:440) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ExtendedPartialViewContextImpl.visitActivatorAtExecute(ExtendedPartialViewContextImpl.java:310) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ExtendedPartialViewContextImpl.getExecuteIds(ExtendedPartialViewContextImpl.java:98) [richfaces-core-impl-4.2.0.Final.jar:]
  at org.richfaces.context.ExtendedPartialViewContextImpl.isExecuteAll(ExtendedPartialViewContextImpl.java:148) [richfaces-core-impl-4.2.0.Final.jar:]
  at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:929) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:]
  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]
  at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]
  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]
  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]
  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]
  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.7.Final.jar:]
  at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.CR1b.jar:7.1.0.CR1b]
  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.7.Final.jar:]
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.7.Final.jar:]
  at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.7.Final.jar:]
  at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.7.Final.jar:]
  at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2033) [jbossweb-7.0.7.Final.jar:]
  at java.lang.Thread.run(Thread.java:722) [:1.7.0_02]
  </code></pre>