Hi It seems the example works under this configurations on 2.1.x branch:
1. Set javax.faces.PARTIAL_STATE_SAVING to false. or 2. Add the page in javax.faces.FULL_STATE_SAVING_VIEW_IDS (disable PSS on the related page only). or 3. Set org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE to true. The reason is simple, in all previous cases what we are doing is mark that part of the tree to be saved fully. I'll give a detailed explanation later, I just wanted to give the workarounds for the time being. regards, Leonardo Uribe 2014-04-10 19:21 GMT+02:00 Leonardo Uribe <[email protected]>: > Hi > > I was able to reproduce the problem. But I can confirm the problem is > gone once you use 2.2.3 and make DynamicTab implements Serializable. > I'll try to find if there is a way to fix it somehow in 2.1.x, so it > can be "less broken". > > regards, > > Leonardo > > 2014-04-10 17:05 GMT+02:00 Volker Weber <[email protected]>: >> Hi, >> >> we are facing a duplicate id exception after adding a component in >> applicationPhase to to view. >> >> We are using c:forEach and add an item to the iterated list in the >> actionListener. >> >> Saving this view is done without problem, but restoring this saved view >> results in a view containing the new component twice! Which results in a >> duplicate id exception when saving this restored view again. >> >> I found that this new component on creation is marked as >> "oam.COMPONENT_ADDED_AFTER_BUILD_VIEW. >> On restore view the facelet is used to recreate the view, which is >> including the new component because it is now included in the forEach >> iteration. >> After recreating the view with the facelet the view is extended with the >> components which were marked with "oam.COMPONENT_ADDED_AFTER_BUILD_VIEW >> when storing the view. >> >> At this point the component is duplicated in the view. >> >> The Problem is in >> org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy >> (row 437 to 451 in 2.1.10 sources), the component is added to the view >> regardless if there is already a component with same id. >> >> I have a example app to reproduce this Problem can downloaded here >> http://www.inexso.net/files/myfaces-dynamic-test.zip . >> >> Run this with "mvn jetty:run" to reproduce this. >> >> Running this with "mvn -Dcontainer=jetty-mojarra jetty:run" did not give >> me any error. >> >> >> Regards, >> Volker >> >> >> -- >> Volker Weber >> -Leiter Software-Entwicklung- >> >> inexso - information exchange solutions GmbH >> Ofener Str. 30 | 26121 Oldenburg >> www.inexso.de >> >> Firmensitz: Oldenburg | Amtsgericht Oldenburg HRB 205251 >> Geschäftsführer: Stefan Schulte, Michael Terschüren >> >>
