1 Reply Latest reply on Mar 3, 2008 4:36 AM by Ilya Shaikovsky

    Rich:tabPanel c:forEach duplicateId oncomplete validation ..

    Metin OSMAN Newbie

      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>
      


      the hidden commandButton to open a new tab

      
       <a4j:commandButton id="openNewClientCommandButton"
       action="#{portalBean.openTask}" ajaxSingle="true" reRender="tabPanel"
       style="display: none;" />
      



      But now, I want to introduce validation on my tab, and I am facing two problems :
      - the first one is that my validator isn't called if I put it into an h:inputText, but works fine inside an h:select*
      - the second one is that I don't want to call the oncomplete js action if there is any validation error

      Notice that I am not satisfied with the way I handle the duplicateId issue.

      So, I hope someone could help me solve these issues, or suggest me a better way to handle the duplicateId one.

      I have read some threads about "render-time" and "build-time" tags, but I don't have clearly understand it (why is c:forEach working inside a rich:tabPanel, but ui:reapet nor a4j:reapet does ?).

      Thanks in advance,