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
52ff8e501975HondaRed
89b508a62003AudiMaroon
b0d293b02004VolkswagenSilver
642fe5482005FiatOrange
299bb9cf1993FordGreen
f0d3d7e21999HondaWhite
a0fdc8ee1981AudiMaroon
fee814541974FordWhite
4b48e1d51997BMWOrange
fd9e7c391967VolkswagenMaroon
<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.