Search code examples
jsf-2datatableprimefaces

JSF 2 Primefaces datatable rowkey


I am using JSF 2.0 with Primefaces M3 and facing a problem with the rowkey attribute. When I try to make a delete feature over the datatable, the scenario throw an exception after the second delete occurred:

javax.faces.FacesException: Cannot find data with given rowKey:4
    at org.primefaces.component.datatable.DataTable.getRowData(DataTable.java:878)
    at org.primefaces.component.datatable.DataHelper.decodeMultipleSelection(DataHelper.java:247)
    at org.primefaces.component.datatable.DataHelper.decodeSelection(DataHelper.java:225)
    at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:61)
    at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:791)
    at javax.faces.component.UIData.processDecodes(UIData.java:981)
    at org.primefaces.component.datatable.DataTable.processDecodes(DataTable.java:575)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
    at org.primefaces.component.layout.Layout.processDecodes(Layout.java:229)
    at javax.faces.component.UIForm.processDecodes(UIForm.java:212)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:920)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    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:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Unknown Source)

*


Solution

  • Try to give the full id in update command for ex- update= "mainForm:mainTab:dataTableid"