Input Style

Free Themes

Built-in component themes created by the PrimeFaces Theme Designer.

Saga Saga
Vela Vela
Arya Arya

Legacy Free Themes

Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink
Nova Nova
Nova Nova Alt
Nova Nova Accent

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.

DataTable Sort

Sorting is enabled with field or sortBy expressions. Both single and multiple column sorting are supported.

Basic
CodeNameCategoryQuantity
f230fh0g3Bamboo WatchAccessories24
nvklal433Black WatchAccessories61
zz21cz3c1Blue BandFitness2
244wgerg2Blue T-ShirtClothing25
h456wer53BraceletAccessories73
av2231fwgBrown PurseAccessories0
bib36pfvmChakra BraceletAccessories5
mbvjkgip5Galaxy EarringsAccessories23
vbb124btrGame ControllerElectronics2
cm230f032Gaming SetElectronics63
Default Sort
CodeNameCategoryQuantity
f230fh0g3Bamboo WatchAccessories24
nvklal433Black WatchAccessories61
h456wer53BraceletAccessories73
av2231fwgBrown PurseAccessories0
bib36pfvmChakra BraceletAccessories5
mbvjkgip5Galaxy EarringsAccessories23
244wgerg2Blue T-ShirtClothing25
vbb124btrGame ControllerElectronics2
cm230f032Gaming SetElectronics63
zz21cz3c1Blue BandFitness2
Multiple Columns

Use metakey to add a column to the sort selection.

CodeNameCategoryQuantityPrice
250vm23ccGreen T-ShirtClothing74$49.0
250vm23ccGreen T-ShirtClothing74$49.0
h456wer53BraceletAccessories73$15.0
h456wer53BraceletAccessories73$15.0
h456wer53BraceletAccessories73$15.0
cm230f032Gaming SetElectronics63$299.0
cm230f032Gaming SetElectronics63$299.0
cm230f032Gaming SetElectronics63$299.0
mnb5mb2m5Pink BandFitness63$79.0
mnb5mb2m5Pink BandFitness63$79.0
2c42cb5cbPurple Gemstone NecklaceAccessories62$45.0
2c42cb5cbPurple Gemstone NecklaceAccessories62$45.0
nvklal433Black WatchAccessories61$72.0
nvklal433Black WatchAccessories61$72.0
nbm5mv45nSneakersClothing52$78.0
nbm5mv45nSneakersClothing52$78.0
09zx9c0zcPainted Phone CaseAccessories41$56.0
vb34btbg5Light Green T-ShirtClothing34$49.0
vb34btbg5Light Green T-ShirtClothing34$49.0
244wgerg2Blue T-ShirtClothing25$29.0
244wgerg2Blue T-ShirtClothing25$29.0
gwuby345vYoga SetFitness25$20.0
f230fh0g3Bamboo WatchAccessories24$65.0
f230fh0g3Bamboo WatchAccessories24$65.0
mbvjkgip5Galaxy EarringsAccessories23$34.0
4920nnc2dGreen EarbudsElectronics23$89.0
4920nnc2dGreen EarbudsElectronics23$89.0
4920nnc2dGreen EarbudsElectronics23$89.0
4920nnc2dGreen EarbudsElectronics23$89.0
4920nnc2dGreen EarbudsElectronics23$89.0
tx125ck42Yoga MatFitness15$20.0
tx125ck42Yoga MatFitness15$20.0
pxpzczo23Purple BandFitness6$79.0
pxpzczo23Purple BandFitness6$79.0
pxpzczo23Purple BandFitness6$79.0
bib36pfvmChakra BraceletAccessories5$32.0
bib36pfvmChakra BraceletAccessories5$32.0
bib36pfvmChakra BraceletAccessories5$32.0
zx23zc42cTeal T-ShirtClothing3$49.0
zz21cz3c1Blue BandFitness2$79.0
av2231fwgBrown PurseAccessories0$120.0
plb34234vGold Phone CaseAccessories0$24.0
plb34234vGold Phone CaseAccessories0$24.0
plb34234vGold Phone CaseAccessories0$24.0
av2231fwgBrown PurseAccessories0$120.0
r23fwf2w3Pink PurseAccessories0$110.0
fldsmn31bGrey T-ShirtClothing0$48.0
lm2tny2k4ShoesClothing0$64.0
fldsmn31bGrey T-ShirtClothing0$48.0
fldsmn31bGrey T-ShirtClothing0$48.0

<h:form>
    <div class="card">
        <h5>Basic</h5>
        <p:dataTable var="product" value="#{dtSortView.products1}" allowUnsorting="true" sortMode="single">
            <p:column field="code" headerText="Code" filterable="false"/>
            <p:column field="name" headerText="Name" sortOrder="asc" filterable="false"/>
            <p:column field="category" headerText="Category" filterable="false"/>
            <p:column field="quantity" headerText="Quantity" filterable="false"/>
        </p:dataTable>
    </div>
    <div class="card">
        <h5>Default Sort</h5>
        <p:dataTable var="product" value="#{dtSortView.products2}" sortMode="multiple"
                     sortBy="#{dtSortView.sortBy}">
            <p:column field="code" headerText="Code" filterable="false"/>
            <p:column field="name" headerText="Name" filterable="false"/>
            <p:column field="category" headerText="Category" filterable="false"/>
            <p:column field="quantity" headerText="Quantity" filterable="false"/>
        </p:dataTable>
    </div>
    <div class="card">
        <h5>Multiple Columns</h5>
        <p>Use metakey to add a column to the sort selection.</p>

        <p:dataTable var="product" value="#{dtSortView.products3}" sortMode="multiple">
            <p:column headerText="Code" sortBy="#{product.code}">
                <h:outputText value="#{product.code}"/>
            </p:column>

            <p:column headerText="Name" sortBy="#{product.name}">
                <h:outputText value="#{product.name}"/>
            </p:column>

            <p:column headerText="Category" sortBy="#{product.category}" sortOrder="asc" sortPriority="2">
                <h:outputText value="#{product.category}"/>
            </p:column>

            <p:column headerText="Quantity" sortBy="#{product.quantity}" sortOrder="desc" sortPriority="1">
                <h:outputText value="#{product.quantity}"/>
            </p:column>

            <p:column headerText="Price" sortBy="#{product.price}">
                <h:outputText value="$#{product.price}"/>
            </p:column>
        </p:dataTable>
    </div>
</h:form>