Skip to main content

Cannot dynamically add components since 2.0.4 upgrade

2 replies [Last post]
jsinglet
Offline
Joined: 2006-05-19
Points: 0

We upgraded our version of mojarra from 2.0.3 to 2.0.4 recently. Since then we have not been able to dynamicall add components any more.
Our application responds to an ajax request by creating a new component and then re-rendering that part of the page. The initial request that creates the component does return a rendering for it, but on a subsequent request the component is no longer in the component tree.
I suspect something in the area of state saving, as I see there were a lot of code changes in that area.
Can anyone confirm this?
Thanks,
John

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jsinglet
Offline
Joined: 2006-05-19
Points: 0

I've investigated this further. It seems to be a quite major regression in the state restoring when restoring dynamically added components.
In my scenario I am adding a component to a component that was previously dynamically added. The new component is a child of the first one.
When the StateManagementStrategyImpl class restores the view it iterates over the list of dynamically added components. In my case the new child is the first item in the list. So when viewRoot.invokeOnComponent is called with the parentClientId it falls to find the parent, as the parent has not yet been added to the view.
Unless there is a good workaround I'd consider this a pretty big regression, the order of processing of the dynamically added elements is pretty important.
Are any of the developers on here and can confirm what I've found?
John

jsinglet
Offline
Joined: 2006-05-19
Points: 0

I've raised an issue for this and attached a patch.
http://java.net/jira/browse/JAVASERVERFACES-1951
John.