3 Replies Latest reply on Sep 1, 2011 7:44 AM by julez

    forEach of columns within forEach of tabs

    julez Newbie

      I have a site with a tabPanel and several tabs, which are all created via a forEach loop.

      Within these tabs is always one big dataTable, which has some dynamic columns, also created via forEach loops.

      The trouble is, when some of the data gets changed and some new columns get added to the dataTable. While athe actual columns get added, the forEach loop starts to behave weird. It iterates twice over some elements. E.g. when I use the varStatus and print out the index of it, the same index shows up twice. By clicking on the selected tab again, everything works fine again.

       

      The inner loop for the header looks like this (inside the dataTable), and similar for the actual data:

       

      {code:xml}

      <f:facet name="header">

           <rich:column colspan="#{viewerBean.nrScores}" id="header_scores">

                <h:outputText value="Scores"/>

           </rich:column>

       

           <c:forEach items="#{viewerBean.scoreFieldShorts}" var="score" varStatus="status">

                <rich:column breakRowBefore="#{status.first}">

                     <h:outputText>#{status.count} #{status.index} #{status.first} #{status.last}<br/> </h:outputText>

                </c:forEach>

           </rich:columnGroup>

      </f:facet>

      {code}

       

      Any suggestions, why this behaves like this?

       

      Thanks,

      Julian