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
8edf050a1976FordSilver
7a058a921987JaguarYellow
6ee44cfb1991VolkswagenBlue
de9c440c1969RenaultOrange
cd20e66c1973JaguarSilver
f0a04ee31994AudiGreen
3361c72a1961VolkswagenBrown
21eda7e51988FiatYellow
2108891c1981VolvoWhite
abc144ce1975VolvoGreen
<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.