Hi everyone,
I am facing an issue causing duplicate id error.
I have a rich:tabPanel component containing c:forEach iteration in order to have a dynamic number of rich:tab.
In most cases, this is working great, but in one tab, i have a commandLink pointing to an action which first close himself and then open another tab.
This action causes the duplicateId error on some unidentified component.
So, the solution I have found is to split my action in 2 actions.
My first commandLink is calling the closing tab action and have oncomplete attribute set to a javascript action calling the click() method of another commandButton, which calls the open tab action.
<a4j:commandLink action="#{client.saveProspect}" oncomplete="document.getElementById('mainForm:openNewClientCommandButton').click();" style="margin-right: 10px;"> <h:graphicImage url="/resources/img/ico-valider 16x16.gif" style="vertical-align: middle;" /> <rich:spacer width="2" /> <h:outputText value="OK" style="font-weight: bold;text-decoration: none;color: black;" /> </a4j:commandLink>
<a4j:commandButton id="openNewClientCommandButton" action="#{portalBean.openTask}" ajaxSingle="true" reRender="tabPanel" style="display: none;" />
question about c:forEach and duplicated ids described fine under facelets resources.