我们在JBoss 7.1.1中发现了Primefaces 3.5的一个奇怪问题。(在所有使用/测试的PF 3.5,JSF 2.1 / 2.2,Java 1.6 / 1.7,JBoss 7.1.1,Tomcat 7.0上)
如果将dataTable与cellEditor结合使用(如演示页面所示),如果表格中有特定数量的行,则排序和选择将停止工作!
我们尝试在JBoss中升级JSF-Version(2.1.7到2.1.22或2.2_9) - 没有效果..调试JSF-Code,不知道..在Tomcat中试过 - 似乎工作!有什么建议!??!猜猜这是PF中的一个错误!?这是代码:
JSF页:
<p:dataTable id="testTable" var="car" value="#{testController.cars}"
editable="true" editMode="cell" widgetVar="carsTable">
<p:ajax event="cellEdit" listener="#{testController.onCellEdit}"
update="@this" />
<p:column headerText="#" sortBy="#{car.id}">
<h:outputText value="#{car.id}" />
</p:column>
<p:column headerText="beschreibung">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.beschreibung}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.beschreibung}" />
</f:facet>
</p:cellEditor>
</p:column>
</p:dataTable>
</h:form>
BackingBean:
@ViewScoped
public class TestController implements Serializable
{
private List<Car> cars = new ArrayList<Car>();
public TestController()
{
for (int i = 0; i <= 1500; i++)
{
Car s = new Car();
s.setId(i);
cars.add(s);
}
}
public List<Car> getCars()
{
return cars;
}
public void setCars(List<Car> cars)
{
this.cars = cars;
}
public void onCellEdit(CellEditEvent event)
{
}
}
例外(JSF 2.1.11)
11:47:5442 ERROR [org.apache.catalina.core.ContainerBase。[jboss.web]。[default-host]。[/ MefistoWeb]。[Faces Servlet]](http - 0.0.0.0- 8080-6)servlet的Servlet.service()Faces Servlet抛出异常:java.lang.NullPointerException at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:441)[jsf-impl-2.1.11.jar:2.1.11] at com.sun.faces.context.PartialViewContextImpl.access $ 300(PartialViewContextImpl.java:71)[jsf-impl-2.1.11.jar:2.1.11] at com.sun.faces.context.PartialViewContextImpl $ DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:582)[jsf-impl-2.1.11.jar:2.1.11] 在javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115)[jsf-api-2.1.11.jar:2.1.11] 在org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:133)[primefaces-3.5.jar:] at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:199)[jsf-impl-2.1.11.jar:2.1.11] at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123)[jsf-impl-2.1.11.jar:2.1.11] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)[jsf-impl-2.1.11.jar:2.1.11] at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)[jsf-impl-2.1.11.jar:2.1.11] 在com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)[jsf-impl-2.1.11.jar:2.1.11] 在javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)[jsf-api-2.1.11.jar:2.1.11] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)[jbossweb-7.0.13.Final.jar:] 在org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)[primefaces-3.5.jar:] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)[jbossweb-7.0.13.Final.jar:] 在org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final] 在org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)[jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)[jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)[jbossweb-7.0.13.Final.jar:] 在org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)[jbossweb-7.0.13.Final.jar:] 在org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:671)[jbossweb-7.0.13.Final.jar:] 在org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:930)[jbossweb-7.0.13.Final.jar:] 在java.lang.Thread.run(Thread.java:722)[rt.jar:1.7.0_15]