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.

TreeTable Sort

Sibling nodes can be sorted within a parent.

Document Viewer (single sort, allowUnsorting)
NameSizeType
Document Viewer (multi sort)
NameSizeType
Document Viewer (multi sort, predefined sort in markup)
NameSizeType
Document Viewer (single sort, predefined sort via code)
NameSizeType

<style type="text/css">
    .ui-treetable table {
        table-layout: fixed
    }
</style>

<h:form>
    <div class="card">
        <p:treeTable value="#{ttBasicView.root}" var="document" sortMode="single" style="margin-top: 20px;"
                     allowUnsorting="true">
            <f:facet name="header">
                Document Viewer (single sort, allowUnsorting)
            </f:facet>
            <p:column headerText="Name" sortBy="#{document.name}">
                <h:outputText value="#{document.name}"/>
            </p:column>
            <p:column headerText="Size" sortBy="#{document.size}">
                <h:outputText value="#{document.size}"/>
            </p:column>
            <p:column headerText="Type" sortBy="#{document.type}">
                <h:outputText value="#{document.type}"/>
            </p:column>
        </p:treeTable>
    </div>

    <div class="card">
        <p:treeTable value="#{ttBasicView.root}" var="document">
            <f:facet name="header">
                Document Viewer (multi sort)
            </f:facet>
            <p:column headerText="Name" sortBy="#{document.name}">
                <h:outputText value="#{document.name}"/>
            </p:column>
            <p:column headerText="Size" sortBy="#{document.size}">
                <h:outputText value="#{document.size}"/>
            </p:column>
            <p:column headerText="Type" sortBy="#{document.type}">
                <h:outputText value="#{document.type}"/>
            </p:column>
        </p:treeTable>
    </div>

    <div class="card">
        <p:treeTable value="#{ttBasicView.root}" var="document" style="margin-top: 20px;">
            <f:facet name="header">
                Document Viewer (multi sort, predefined sort in markup)
            </f:facet>
            <p:column headerText="Name" sortBy="#{document.name}" sortOrder="desc" sortPriority="1">
                <h:outputText value="#{document.name}"/>
            </p:column>
            <p:column headerText="Size" sortBy="#{document.size}" sortOrder="asc" sortPriority="2">
                <h:outputText value="#{document.size}"/>
            </p:column>
            <p:column headerText="Type" sortBy="#{document.type}">
                <h:outputText value="#{document.type}"/>
            </p:column>
        </p:treeTable>
    </div>

    <div class="card">
        <p:treeTable value="#{ttBasicView.root}" var="document" sortMode="single" style="margin-top: 20px;"
                     sortBy="#{ttBasicView.sortBy}">
            <f:facet name="header">
                Document Viewer (single sort, predefined sort via code)
            </f:facet>
            <p:column headerText="Name" sortBy="#{document.name}">
                <h:outputText value="#{document.name}"/>
            </p:column>
            <p:column headerText="Size" sortBy="#{document.size}">
                <h:outputText value="#{document.size}"/>
            </p:column>
            <p:column headerText="Type" sortBy="#{document.type}">
                <h:outputText value="#{document.type}"/>
            </p:column>
        </p:treeTable>
    </div>
</h:form>