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
7be6628b2007JaguarBrown
b079bac71996BMWBrown
0c9eeb1c1987AudiBlue
f0b3b4a92003BMWBrown
21095f8a2007FordBlack
6112ce321974AudiYellow
27f9a9da1966AudiBlack
311b83651991MercedesBrown
47d3cec11976BMWBlack
bcc4e7f81960RenaultBrown
<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.