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.

Tree Selection

Tree provides three selection modes, "single", "multiple" and "checkbox".

Single
Multiple with metakey
Checkbox

<div class="card">
    <h:form>
        <p:growl id="msgs" showDetail="true" escape="false"/>

        <h5 class="p-mt-0">Single</h5>
        <p:tree value="#{treeSelectionView.root1}" var="doc"
                selectionMode="single"
                selection="#{treeSelectionView.selectedNode}">
            <p:treeNode expandedIcon="pi pi-folder-open" collapsedIcon="pi pi-folder">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="app" icon="pi pi-save">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="document" icon="pi pi-file">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="excel" icon="pi pi-file-excel">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="travel" icon="pi pi-file-pdf">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="picture" icon="pi pi-image">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="video" icon="pi pi-video">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
        </p:tree>

        <p:commandButton value="Display" update="msgs" icon="pi pi-clone" styleClass="p-mt-3"
                         action="#{treeSelectionView.displaySelectedSingle}"/>

        <h5>Multiple with metakey</h5>
        <p:tree value="#{treeSelectionView.root2}" var="doc"
                selectionMode="multiple"
                selection="#{treeSelectionView.selectedNodes1}">
            <p:treeNode expandedIcon="pi pi-folder-open" collapsedIcon="pi pi-folder">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="app" icon="pi pi-save">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="document" icon="pi pi-file">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="excel" icon="pi pi-file-excel">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="travel" icon="pi pi-file-pdf">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="picture" icon="pi pi-image">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="video" icon="pi pi-video">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
        </p:tree>

        <p:commandButton value="Display" update="msgs" icon="pi pi-clone" styleClass="p-mt-3"
                         action="#{treeSelectionView.displaySelectedMultiple(treeSelectionView.selectedNodes1)}"/>

        <h5>Checkbox</h5>
        <p:tree value="#{treeSelectionView.root3}" var="doc"
                selectionMode="checkbox"
                selection="#{treeSelectionView.selectedNodes2}">
            <p:treeNode expandedIcon="pi pi-folder-open" collapsedIcon="pi pi-folder">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="app" icon="pi pi-save">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="document" icon="pi pi-file">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="excel" icon="pi pi-file-excel">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="travel" icon="pi pi-file-pdf">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="picture" icon="pi pi-image">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
            <p:treeNode type="video" icon="pi pi-video">
                <h:outputText value="#{doc.name}"/>
            </p:treeNode>
        </p:tree>

        <p:commandButton value="Display" update="msgs" icon="pi pi-clone" styleClass="p-mt-3"
                         action="#{treeSelectionView.displaySelectedMultiple(treeSelectionView.selectedNodes2)}"/>
    </h:form>
</div>