5 Replies Latest reply on Aug 28, 2008 9:39 PM by Jason Grant

    Nested dataTable with dynamic number of columns

    Jason Grant Newbie

      I am hopeful that it is possible to render columns within a subTable, where the number of columns are defined at runtime.

      I've tried many experiments based on the code snippet below, but the table fails to render. Note how the columns are effectively obtained via row.subRow.getColumns(), and I suspect this is problematic.

      Tips on how to resolve or troubleshoot this issue would be most appreciated.

      Jason.

      <rich:dataTable value="#{jasonBean.getOuterRows()}" var="row">
       <rich:column breakBefore="true">
       <!-- Table nested in a column -->
       <rich:subTable value="#{row.getSubRows()}" var="subRow">
       <!-- Number of cols in subTable is determined at runtime -->
       <rich:columns value="#{subRow.getColumns()}" var="subColumn">
       <h:outputText value="#{subColumn.value}"/>
       </rich:columns>
       </rich:subTable>
       </rich:column>
      </rich:dataTable>