JARCH SHOWCASE
JARCH SHOWCASE
DataTable - Group DataTable column headers and footers can be combined for grouped display.
Sales/Profits of Manufacturers
ManufacturerSale Rate
SalesProfit
Last YearThis YearLast YearThis Year
Apple49%76%$ 43.364,00$ 45.171,00
Samsung90%41%$ 27.895,00$ 71.809,00
Microsoft32%14%$ 84.768,00$ 3.152,00
Philips77%31%$ 57.608,00$ 94.337,00
Sony29%16%$ 64.026,00$ 7.399,00
LG2%4%$ 21.368,00$ 86.990,00
Sharp75%9%$ 70.440,00$ 68.612,00
Panasonic62%20%$ 83.532,00$ 26.892,00
HTC78%61%$ 35.323,00$ 11.354,00
Nokia13%85%$ 35.678,00$ 10.237,00
Totals:$524.002$425.953
Dynamic Columns
PlayerGoals
20102011201220132014
Lionel Messi3514153542
Cristiano Ronaldo344713225
Arjen Robben213410212
Franck Ribery2542363511
Ronaldinho4145483147
Luis Suarez25458831
Sergio Aguero4117471417
Zlatan Ibrahimovic1412472838
Neymar Jr4238481627
Andres Iniesta112172028
   
<a:form>
    <a:dataTable var="sale" value="#{dtGroupView.sales}">
        <f:facet name="header">
            Sales/Profits of Manufacturers
        </f:facet>

        <a:columnGroup type="header">
            <a:row>
                <a:column rowspan="3" headerText="Manufacturer" />
                <a:column colspan="4" headerText="Sale Rate" />
            </a:row>
            <a:row>
                <a:column colspan="2" headerText="Sales" />
                <a:column colspan="2" headerText="Profit" />
            </a:row>
            <a:row>
                <a:column headerText="Last Year" />
                <a:column headerText="This Year" />
                <a:column headerText="Last Year" />
                <a:column headerText="This Year" />
            </a:row>
        </a:columnGroup>

        <a:column>
            <h:outputText value="#{sale.manufacturer}" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.lastYearProfit}%" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.thisYearProfit}%" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.lastYearSale}">
                <f:convertNumber type="currency" currencySymbol="$" />
            </h:outputText>
        </a:column>
        <a:column>
            <h:outputText value="#{sale.thisYearSale}">
                <f:convertNumber type="currency" currencySymbol="$" />
            </h:outputText>
        </a:column>

        <a:columnGroup type="footer">
            <a:row>
                <a:column colspan="3" style="text-align:right" footerText="Totals:" />
                <a:column footerText="$#{dtGroupView.lastYearTotal}" />

                <a:column footerText="$#{dtGroupView.thisYearTotal}" />
            </a:row>
        </a:columnGroup>

        <f:facet name="footer">
            Data between 2013-2014
        </f:facet>
    </a:dataTable>

    <a:dataTable var="player" value="#{dtGroupView.players}" style="margin-top:40px">
        <f:facet name="header">
            Dynamic Columns
        </f:facet>

        <a:columnGroup type="header">
            <a:row>
                <a:column rowspan="2" headerText="Player" />
                <a:column colspan="#{dtGroupView.yearCount}" headerText="Goals" />
            </a:row>
            <a:row>
                <ui:repeat value="#{dtGroupView.years}" var="year">
                    <a:column headerText="#{year}" />
                </ui:repeat>
            </a:row>
        </a:columnGroup>

        <a:column>
            <h:outputText value="#{player.name}" />
        </a:column>

        <a:columns value="#{dtGroupView.years}" var="year">
            <h:outputText value="#{player.getGoals(year)}" />
        </a:columns>

        <f:facet name="footer">
            Data between 2010-2014
        </f:facet>
    </a:dataTable>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.