Problem with Multiple data tables with dynamic columns
ujjets Mar 23, 2011 2:50 PMI need to display multiple data tables by looping thro a list of objects.
The tables have dynamic columns
**********************************
<c:forEach items="#{items}" var="item" varStatus="itemIdx">
<rich:dataTable id="searchResultTable#{itemIdx.index}">
<f:facet name="header">
<rich:columnGroup >
<rich:column rowspan="2">Column</rich:column>
<rich:columns value="#{bean.getColHeads(itemIdx.index,true)}"
var="column" breakBefore="#{column.breakBefore}">
<h:outputText value="#{column.headerValue}"/>
</rich:columns>
</rich:columnGroup>
</f:facet>
<f:facet name="footer">
<rich:subTable value="#{item.vals}" var="member" rowKeyVar="memberKey">
<rich:subTable value="#{member.dim}" var="dim" rowKeyVar="dimKey">
<rich:column width="90px"
rendered="#{memberKey eq 0 and
dimKey eq 0}"
rowspan="calculate row span">
<h:outputText value="#{item.val}" />
</rich:column>
<rich:columns styleClass="text-center" width="30px" var="scr"
value="#{bean.getRow(itemIdx.index, memberKey, dimKey)}">
<h:outputText value="#{scr}" />
</rich:columns>
</rich:subTable>
</rich:subTable>
</f:facet>
</rich:dataTable>
<br/>
</c:forEach>
*************************************
The problem is ,I can only get it to work with c:foreach.
when I use a:repeat, the dynamic columns are displayed correctly.
Its like , if the first table has 8 dynamic columns then all preceding tables are generated with 8 columns.
If the 1st table has 10 columns and if the second has only 8 then two blank columns are being created.
The size of the rich columns being generated is not adjusted to the columns required for the current item.
Also the table header part is displayed but the table data part is not being rendered with the footer facet tag.
Please let me know if anyone has any suggestions.Thanks in advance.
The tables have dynamic columns
**********************************
<c:forEach items="#{items}" var="item" varStatus="itemIdx">
<rich:dataTable id="searchResultTable#{itemIdx.index}">
<f:facet name="header">
<rich:columnGroup >
<rich:column rowspan="2">Column</rich:column>
<rich:columns value="#{bean.getColHeads(itemIdx.index,true)}"
var="column" breakBefore="#{column.breakBefore}">
<h:outputText value="#{column.headerValue}"/>
</rich:columns>
</rich:columnGroup>
</f:facet>
<f:facet name="footer">
<rich:subTable value="#{item.vals}" var="member" rowKeyVar="memberKey">
<rich:subTable value="#{member.dim}" var="dim" rowKeyVar="dimKey">
<rich:column width="90px"
rendered="#{memberKey eq 0 and
dimKey eq 0}"
rowspan="calculate row span">
<h:outputText value="#{item.val}" />
</rich:column>
<rich:columns styleClass="text-center" width="30px" var="scr"
value="#{bean.getRow(itemIdx.index, memberKey, dimKey)}">
<h:outputText value="#{scr}" />
</rich:columns>
</rich:subTable>
</rich:subTable>
</f:facet>
</rich:dataTable>
<br/>
</c:forEach>
*************************************
The problem is ,I can only get it to work with c:foreach.
when I use a:repeat, the dynamic columns are displayed correctly.
Its like , if the first table has 8 dynamic columns then all preceding tables are generated with 8 columns.
If the 1st table has 10 columns and if the second has only 8 then two blank columns are being created.
The size of the rich columns being generated is not adjusted to the columns required for the current item.
Also the table header part is displayed but the table data part is not being rendered with the footer facet tag.
Please let me know if anyone has any suggestions.Thanks in advance.