Locale

Language
English
English
English
French
German
German
Italian
Korean
Spanish
Catalan
Dutch
Portuguese
Portuguese
Arabic
Arabic
Bulgarian
Czech
Greek
Persian
Finnish
Danish
Hindi
Indonesian
Croatian
Japanese
Hungarian
Hebrew
Georgian
Central Kurdish
Khmer
Kyrgyz
Kazakh
Lithuanian
Latvian
Malay
Norwegian
Polish
Romanian
Russian
Slovak
Slovenian
Serbian
Swedish
Thai
Turkish
Ukrainian
Vietnamese
Chinese
Chinese

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

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
Basic (shorthand notation)
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.00
250vm23ccGreen T-ShirtClothing74$49.00
h456wer53BraceletAccessories73$15.00
h456wer53BraceletAccessories73$15.00
h456wer53BraceletAccessories73$15.00
cm230f032Gaming SetElectronics63$299.00
mnb5mb2m5Pink BandFitness63$79.00
mnb5mb2m5Pink BandFitness63$79.00
nvklal433Black WatchAccessories61$72.00
nvklal433Black WatchAccessories61$72.00
nvklal433Black WatchAccessories61$72.00
v435nn85nMini SpeakersClothing42$85.00
09zx9c0zcPainted Phone CaseAccessories41$56.00
vb34btbg5Light Green T-ShirtClothing34$49.00
vb34btbg5Light Green T-ShirtClothing34$49.00
vb34btbg5Light Green T-ShirtClothing34$49.00
244wgerg2Blue T-ShirtClothing25$29.00
244wgerg2Blue T-ShirtClothing25$29.00
gwuby345vYoga SetFitness25$20.00
mbvjkgip5Galaxy EarringsAccessories23$34.00
mbvjkgip5Galaxy EarringsAccessories23$34.00
4920nnc2dGreen EarbudsElectronics23$89.00
4920nnc2dGreen EarbudsElectronics23$89.00
tx125ck42Yoga MatFitness15$20.00
k8l6j58jlLime BandFitness12$79.00
k8l6j58jlLime BandFitness12$79.00
pxpzczo23Purple BandFitness6$79.00
pxpzczo23Purple BandFitness6$79.00
pxpzczo23Purple BandFitness6$79.00
pxpzczo23Purple BandFitness6$79.00
zx23zc42cTeal T-ShirtClothing3$49.00
vbb124btrGame ControllerElectronics2$99.00
zz21cz3c1Blue BandFitness2$79.00
zz21cz3c1Blue BandFitness2$79.00
zz21cz3c1Blue BandFitness2$79.00
zz21cz3c1Blue BandFitness2$79.00
r23fwf2w3Pink PurseAccessories0$110.00
av2231fwgBrown PurseAccessories0$120.00
av2231fwgBrown PurseAccessories0$120.00
plb34234vGold Phone CaseAccessories0$24.00
av2231fwgBrown PurseAccessories0$120.00
plb34234vGold Phone CaseAccessories0$24.00
lm2tny2k4ShoesClothing0$64.00
lm2tny2k4ShoesClothing0$64.00
fldsmn31bGrey T-ShirtClothing0$48.00
lm2tny2k4ShoesClothing0$64.00
lm2tny2k4ShoesClothing0$64.00
lm2tny2k4ShoesClothing0$64.00
lm2tny2k4ShoesClothing0$64.00
fldsmn31bGrey T-ShirtClothing0$48.00

<h:form>
    <div class="card">
        <h5>Basic</h5>
        <p:dataTable var="product" value="#{dtSortView.products1}" allowUnsorting="true" sortMode="single">
            <p:column sortBy="#{product.code}" headerText="Code">
                <h:outputText value="#{product.code}"/>
            </p:column>
            <p:column sortBy="#{product.name}" headerText="Name" sortOrder="asc">
                <h:outputText value="#{product.name}"/>
            </p:column>
            <p:column sortBy="#{product.category}" headerText="Category">
                <h:outputText value="#{product.category}"/>
            </p:column>
            <p:column sortBy="#{product.quantity}" headerText="Quantity">
                <h:outputText value="#{product.quantity}"/>
            </p:column>
        </p:dataTable>
    </div>
    <div class="card">
        <h5>Basic (shorthand notation)</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}">
                    <f:convertNumber type="currency" currencySymbol="$"/>
                </h:outputText>
            </p:column>
        </p:dataTable>
    </div>
</h:form>