tags:

views:

66

answers:

1

I have an List of items which need to be displayed as a table. That table need to be repeated as a two-column grid where each cell contains the same table side by side where the right side is a continuation of the right side table, like so:

a|b|c  a|b|c
-+-+-  -+-+-
1|2|3  5|6|7
x|y|z  n|m|o
.....  .....

How can I achieve this?

A: 

Maybe you could make your managed bean return list of lists and use <ui:repeat> and <h:dataTable>. Each of your internal list is for one table, and contains table rows.

<ui:repeat value="#{bean.tablesLists}" var="tableList">
  <h:dataTable var="tableRow" value="#{tableList}">
    <h:column>
      <f:facet name="header">
        <h:outputText value="a" />
      </f:facet>
      <h:outputText value="#{tableRow.data1}" />
    </h:column>
    <h:column>
      <f:facet name="header">
        <h:outputText value="b" />
      </f:facet>
      <h:outputText value="#{tableRow.data2}" />
    </h:column>
  </h:dataTable>
</ui:repeat>
amorfis
Thanks. I was not considering facelet before this post but find it to be my last avenue. I am able to do it with just the one list.