JARCH SHOWCASE
JARCH SHOWCASE
DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
7a8e708d1981HondaBlue
1b9c9b921980JaguarOrange
ed2f46a81999AudiMaroon
2051721d1981FordBrown
3e61b5a01972HondaYellow
c35f52442002VolvoSilver
4ce9dc2a1998FordRed
446970d41994AudiBlack
78053d661986BMWRed
550a51c71992HondaOrange
<a:dataTable var="car" value="#{dtBasicView.cars}" rowStyleClass="#{car.year le 1990 ? 'old' : null}">
    <a:column headerText="Id">
        <h:outputText value="#{car.id}" />
    </a:column>

    <a:column headerText="Year">
        <h:outputText value="#{car.year}" />
    </a:column>

    <a:column headerText="Brand">
        <h:outputText value="#{car.brand}" />
    </a:column>

    <a:column headerText="Color">
        <h:outputText value="#{car.color}" />
    </a:column>
</a:dataTable>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.