1 Reply Latest reply on Sep 11, 2009 11:32 PM by Mikael Andersson

    rich:subTable

    Jack Y Newbie

      Hi


            Now i'm using rich:subtable inside dataTable,.,I have an employees list...Each employee has a 4 or 5 components...I used the code below...But its displaying all components for all employees...




      <rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" 
                              width="430px" height="350px" sortMode="single" id="previewList" var="pay" rowKeyVar="i" value="#{emppayrolldefnHome.previewList}">
           <f:facet name="header">
           <rich:columnGroup>
                       <rich:column>
                      <h:outputText value="Employee Name"/>
                       </rich:column>
                       <rich:column>
                     <h:outputText value="Amount"/>
                       </rich:column>
              </rich:columnGroup>
           </f:facet>
           <rich:column>
                <h:outputText value="#{empmasterList.getEmpName(pay.id.empId)}"/>
           </rich:column>
           <rich:subTable OnRowMouseOver="this.style.backgroundColor='#F8F8F8'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"                       var="pay1" value="#{emppayrolldefnHome.componentList}">
                <rich:column>
                        <h:outputText value="#{pay1.prcompId}"/>
                      </rich:column>
                      <rich:column>
                           <h:outputText value="#{pay1.pramount}"/>
                      </rich:column>
           </rich:subTable>
              <f:facet name="footer">
                                <rich:columnGroup>
                                <rich:column>
                                     <h:outputText value="#{messages.Total}"/>
                                </rich:column>
                                <rich:column>
                                  <h:outputText id="totamount" style="text-align: right;" value="#{emppayrolldefnHome.instance.totalAmount}">
                                       <f:convertNumber pattern="#,##,##,##,##0.00" type="currency"  currencySymbol="rs" currencyCode="INR"/>
                                  </h:outputText>                          
                                </rich:column>
                                </rich:columnGroup>
                </f:facet>
      </rich:dataTable>               
      



        • 1. Re: rich:subTable
          Mikael Andersson Master

          Hi


          You need to check what #{emppayrolldefnHome.componentList} returns.


          Usually you would get some date form the pay variable which you use in the surrounding data table.


          For example the pay variable could contain the component list to show in the sub table.


          - Micke