2 Replies Latest reply on Aug 14, 2009 6:34 AM by Nick Belaevski

    Wants to group rows of first column of rich:subtable

    sarvesh kaushik Newbie

      Hi,

      I am using rich:subtables under parent rich:datatable. Number of columns in parent table is dynamic and subtable is dependent upon the parent table so column of subtable is dynamic too and number of subtable are dynamic too.

      Problem:
      I want to group rows of first column of each of the subtable and to display only a common text for all the rows of that single table subtable. Same thing I want to do for every subtable.

      I am not using any header or footer in my subtable.

      I have no idea how too implement this functionality.

      I am pasting my code too: Please review my code and tell what to do.

      Thanx for your response.

      <rich:dataTable
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      cellpadding="0" cellspacing="0" width="700" border="0"
      value="#{cisDetailsBacking.postalSectorDetails}"
      var="postalSectorDetail">

      <f:facet name="header">

      <rich:columnGroup>
      <rich:column rowspan="2">
      <rich:spacer />
      </rich:column>
      <rich:column colspan="1">
      <h:outputText value="Client" />
      </rich:column>
      <rich:columns
      value="#{cisDetailsBacking.clientDetail.clientName}"
      var="aclientName" index="ind" id="column#{ind}">
      <h:outputText value="#{aclientName}" />
      </rich:columns>
      <rich:column breakBefore="true">
      <h:outputText value="C\N\Brief No" />
      </rich:column>
      <rich:columns value="#{cisDetailsBacking.clientDetail.briefNo}"
      var="abriefNo">
      <h:outputText value="#{abriefNo}" />
      </rich:columns>
      <rich:column breakBefore="true">
      <h:outputText value="Sector"></h:outputText>
      </rich:column>
      <rich:column>
      <h:outputText value="Round"></h:outputText>
      </rich:column>
      <rich:columns
      value="#{cisDetailsBacking.clientDetail.textAllocation}"
      var="atextAllocation">
      <h:outputText value="#{atextAllocation}"></h:outputText>
      </rich:columns>
      </rich:columnGroup>
      </f:facet>

      <rich:subTable
      onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
      var="roundDetail" value="#{postalSectorDetail.roundDetails}">

      <rich:column style="text-align:center;">
      <h:outputText value="#{roundDetail.sectorName}"></h:outputText>

      </rich:column>
      <rich:column style="text-align:center;">
      <h:outputText value="#{roundDetail.roundName}"></h:outputText>

      </rich:column>
      <rich:columns
      value="#{cisDetailsBacking.clientDetail.textAllocation}"
      var="atextAllocation" index="ind3" id="column3#{ind3}"
      style="text-align:center;">
      <h:outputText value="#{roundDetail.roundAllocation.get(ind3)}"></h:outputText>
      </rich:columns>

      </rich:subTable>

      <f:facet name="footer">
      <rich:columnGroup>
      <rich:column colspan="2" style="text-align:center;">
      <h:outputText value="Total Allocations"></h:outputText>
      </rich:column>
      <rich:columns
      value="#{cisDetailsBacking.clientDetail.totalAllocationClient}"
      var="totalAllocation" style="text-align:center;">
      <h:outputText value="#{totalAllocation}"></h:outputText>
      </rich:columns>
      </rich:columnGroup>
      </f:facet>
      </rich:dataTable>