[richfaces-issues] [JBoss JIRA] (RF-11681) rich:dataTable crashes on postback when columns are dynamically added when partial state saving is enabled

Brian Leathem (Updated) (JIRA) jira-events at lists.jboss.org
Mon Nov 14 12:47:42 EST 2011


     [ https://issues.jboss.org/browse/RF-11681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-11681:
-------------------------------

    Fix Version/s: 4.2.0.Tracking

    
> rich:dataTable crashes on postback when columns are dynamically added when partial state saving is enabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: RF-11681
>                 URL: https://issues.jboss.org/browse/RF-11681
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-tables
>    Affects Versions: 4.0.0.Final
>         Environment: Mojarra 2.1.3, 2.1.4, JBoss AS 6.0, JBoss AS 6.10
>            Reporter: henk de boer
>             Fix For: 4.2.0.Tracking
>
>
> When columns are dynamically added to a rich:dataTable, a crash will occur after a postback:
> {noformat}
> java.lang.NullPointerException
> 	at com.sun.faces.application.view.StateManagementStrategyImpl$4.visit(StateManagementStrategyImpl.java:331)
> 	at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
> 	at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1235)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at javax.faces.component.UIForm.visitTree(UIForm.java:344)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
> 	at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:326)
> 	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:452)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
> 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
> 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> {noformat}
> The crash happens if the columns are added either in a backing bean or from another component (in both cases in a PreRenderView event handler, which is a save moment to modify the component tree).
> If instead of a {{rich:dataTable}} an {{h:dataTable}} is used, the code works as expected. 
> With the {{rich:dataTable}}, the statemanager tries to find an ID that looks e.g. like: {{j_idt98:j_idt99:j_id2}}, but in the rendered markup only IDs like {{j_idt98:j_idt99:0:j_id2}} and {{j_idt98:j_idt99:0:j_id3}} are found. In the state map however only IDs of the form {{j_idt98:j_idt99:0:j_id3}} and {{j_idt98:j_idt99:0:j_id4}} are there.
> Summary of the ids expected and the ids found:
> ||Context||ID||
> |statemanager|{{j_idt98:j_idt99:j_id2}}|
> |rendered markup|{{j_idt98:j_idt99:0:j_id2}} \\ {{j_idt98:j_idt99:0:j_id3}}|
> |state map|{{j_idt98:j_idt99:0:j_id3}} \\ {{j_idt98:j_idt99:0:j_id4}}|

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list