JARCH SHOWCASE
JARCH SHOWCASE
DataTable - Sort Sorting is enabled with sortBy expressions. Both single and multiple column sorting are supported.
Single Column Sort
IdYearBrandColor
490afaf31985JaguarRed
836298861992VolvoGreen
82a0f1b81995VolkswagenGreen
6941c8db1990JaguarBlack
7179322c1960VolkswagenBrown
22601ed32001AudiGreen
7eba25141968BMWGreen
0371e47e1982JaguarRed
6bba6f281968FordRed
f82f8bef2005HondaWhite
Editable Values
IdYearBrandColor
Multiple Column Sort with Metakey
IdYearBrandColor
<a:form>
    <a:dataTable var="car" value="#{dtSortView.cars1}" style="margin-bottom:40px">
        <f:facet name="header">
            Single Column Sort
        </f:facet>
        <a:column headerText="Id" sortBy="#{car.id}">
            <h:outputText value="#{car.id}" />
        </a:column>

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

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

        <a:column headerText="Color" sortBy="#{car.color}">
            <h:outputText value="#{car.color}" />
        </a:column>
    </a:dataTable>

    <a:dataTable var="car" value="#{dtSortView.cars2}" style="margin-bottom:40px">
        <f:facet name="header">
            Editable Values
        </f:facet>
        <a:ajax event="sort" skipChildren="false" />
        <a:column headerText="Id" sortBy="#{car.id}">
            <a:inputText value="#{car.id}" />
        </a:column>

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

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

        <a:column headerText="Color" sortBy="#{car.color}">
            <a:inputText value="#{car.color}" />
        </a:column>
    </a:dataTable>

    <a:dataTable var="car" value="#{dtSortView.cars3}" sortMode="multiple">
        <f:facet name="header">
            Multiple Column Sort with Metakey
        </f:facet>
        <a:column headerText="Id" sortBy="#{car.id}">
            <h:outputText value="#{car.id}" />
        </a:column>

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

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

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