https://facelets.dev.java.net/issues/show_bug.cgi?id=360 Issue #|360
Summary|c:forEach: duplicated ID when component removed and th
|en added back
Component|facelets
Version|1.1.14
Platform|All
OS/Version|All
URL|
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|DEFECT
Priority|P3
Subcomponent|impl
Assigned to|issues@facelets
Reported by|ishaikovsky
------- Additional comments from
ishaikovsky@... Wed Nov 4 14:53:27 +0000 2009 -------
The issue originally not related to id's I just simplified https://
jira.jboss.org/jira/browse/RF-7962 case.
Test case war attached.
Related Code
<h:form>
<h:inputText value="#{bean.number}" />
<h:commandButton value="Add" action="#{bean.add}"/>
<h:commandButton value="Remove" action="#{bean.remove}"/>
</h:form>
<h:panelGrid>
<c:forEach items="#{bean.tabs}" var="number">
<h:outputText id="tab#{number}" value="#{number}" />
</c:forEach>
</h:panelGrid>
Bean contains ArrayList of Strings. We removing String "2". And getting "1" and
"3" fine rendered. BUT: <ui:debug/> shows us that there are still three
outputText components in tree. And after we trying to add "2" back - duplicated
id exception risen.
If after removing but before adding we will refresh the page - this issue will
not appears. Also the problem not reproduced if we removing last imtem from
list instead of second.
We investigated the case and found out that seems when forEach handler invoked
on build view - component handler doesn't process last component because of the
collection new length.
---------------------------------------------------------------------
To unsubscribe, e-mail:
issues-unsubscribe@...
For additional commands, e-mail:
issues-help@...