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
3b0695671980VolvoOrange
c85cf1492004FiatBlue
a8f0fd301960FordWhite
0df780db1971VolkswagenBlue
1f85f45a1998HondaBlack
3d84fec31996MercedesBlue
f73b39281970BMWMaroon
846dad831985VolkswagenRed
8d79c2011963BMWOrange
525f75541965AudiMaroon
<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.