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

TreeTable Edit

Data displayed on treetable can be edited at row or cell level.

Row Editing
NameSizeType
Cell Editing
NameSizeType
Cell Editing can be triggered by a custom event, like double click (dblclick)
NameSizeType

<style>
    .ui-editable-column .ui-cell-editor-input {
        overflow: hidden;
    }

    .ui-editable-column .ui-cell-editor-input * {
        box-sizing: border-box;
    }
</style>


<h:form id="form">
    <p:growl id="msgs" showDetail="true"/>

    <div class="card">
        <h5>Row Editing</h5>
        <p:treeTable value="#{ttEditView.root}" editable="true" var="document">

            <p:ajax event="rowEdit" listener="#{ttEditView.onRowEdit}" update=":form:msgs"/>
            <p:ajax event="rowEditCancel" listener="#{ttEditView.onRowCancel}" update=":form:msgs"/>

            <p:column headerText="Name">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.name}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.name}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Size">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.size}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.size}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Type">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.type}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.type}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column style="width:6rem">
                <p:rowEditor/>
            </p:column>
        </p:treeTable>
    </div>

    <div class="card">
        <h5>Cell Editing</h5>
        <p:treeTable value="#{ttEditView.root2}" editable="true" editMode="cell" var="document">

            <p:ajax event="cellEdit" listener="#{ttEditView.onCellEdit}" update=":form:msgs"/>

            <p:column headerText="Name">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.name}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.name}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Size">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.size}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.size}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Type">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.type}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.type}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
        </p:treeTable>
    </div>

    <div class="card">
        <h5>Cell Editing can be triggered by a custom event, like double click (dblclick)</h5>
        <p:treeTable value="#{ttEditView.root2}" editable="true" editMode="cell" var="document"
                     editInitEvent="dblclick" style="margin-bottom:20px">

            <p:ajax event="cellEdit" listener="#{ttEditView.onCellEdit}" update=":form:msgs"/>

            <p:column headerText="Name">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.name}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.name}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Size">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.size}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.size}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
            <p:column headerText="Type">
                <p:cellEditor>
                    <f:facet name="output"><h:outputText value="#{document.type}"/></f:facet>
                    <f:facet name="input"><p:inputText value="#{document.type}" style="width:100%"/></f:facet>
                </p:cellEditor>
            </p:column>
        </p:treeTable>
    </div>
</h:form>