PrimeFaces 3.5 - DataTable - 手动排序后删除列上的NPE

时间:2017-04-20 12:48:41

标签: jsf primefaces datatable

我们的数据表具有动态列并且可以排序。用户可以添加和删除列。总的来说,除了一种情况外,它运作良好。当用户将表w.r.t中的数据排序到表中的最后一列然后删除最后一列时,会出现NullPointerException。如果列不是最后一列则根本没有问题。

以下是堆栈跟踪。任何线索是否/如何修复。

[#|2017-04-20T14:02:59.021+0200|SEVERE|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.application|_ThreadID=119;_ThreadName=Thread-2;|Error Rendering View[/view/instrumentmgmt/instrumentManager.xhtml]
java.lang.NullPointerException
    at org.primefaces.component.datatable.DataTable.findColumn(DataTable.java:711)
    at org.primefaces.component.datatable.feature.SortFeature.singleSort(SortFeature.java:124)
    at org.primefaces.component.datatable.DataTableRenderer.preRender(DataTableRenderer.java:99)
    at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:80)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:877)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1826)
    at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:543)
    at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
    at org.primefaces.component.api.UIData.visitTree(UIData.java:683)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIForm.visitTree(UIForm.java:371)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
    at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383)
    at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:302)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:421)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
    at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

0 个答案:

没有答案