我正在使用带有Primefaces M3的JSF 2.0并面临rowkey属性的问题。当我尝试在数据表上创建删除功能时,该方案在第二次删除后抛出异常:
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)
*
答案 0 :(得分:0)
单击删除按钮后,尝试通过ajax更新数据表。
答案 1 :(得分:0)
尝试在更新命令中为ex- update =“mainForm:mainTab:dataTableid”提供完整的id