JARCH SHOWCASE
JARCH SHOWCASE
TreeTable - Selection Tree provides three selection modes, "single", "multiple" and "checkbox" in addition to the regular column based selection.
Single
NameSizeType
Multiple with metakey
NameSizeType
Checkbox
NameSizeType
<a:form>
    <a:growl id="msgs" showDetail="true" escape="false"/>

    <a:treeTable value="#{ttSelectionView.root1}" var="document" selectionMode="single" selection="#{ttSelectionView.selectedNode}" style="margin-top:0">
        <f:facet name="header">
            Single
        </f:facet>
        <a:column headerText="Name">
            <h:outputText value="#{document.name}" />
        </a:column>
        <a:column headerText="Size">
            <h:outputText value="#{document.size}" />
        </a:column>
        <a:column headerText="Type">
            <h:outputText value="#{document.type}" />
        </a:column>
    </a:treeTable>

    <a:commandButton value="Display" update="msgs" icon="ui-icon-newwin"
                        actionListener="#{ttSelectionView.displaySelectedSingle}"/>

    <a:treeTable value="#{ttSelectionView.root2}" var="document" selectionMode="multiple" selection="#{ttSelectionView.selectedNodes1}">
        <f:facet name="header">
            Multiple with metakey
        </f:facet>
        <a:column headerText="Name">
            <h:outputText value="#{document.name}" />
        </a:column>
        <a:column headerText="Size">
            <h:outputText value="#{document.size}" />
        </a:column>
        <a:column headerText="Type">
            <h:outputText value="#{document.type}" />
        </a:column>
    </a:treeTable>

    <a:commandButton value="Display" update="msgs" icon="ui-icon-newwin"
                     actionListener="#{ttSelectionView.displaySelectedMultiple(ttSelectionView.selectedNodes1)}"/>

    <a:treeTable value="#{ttSelectionView.root3}" var="document" selectionMode="checkbox" selection="#{ttSelectionView.selectedNodes2}">
        <f:facet name="header">
            Checkbox
        </f:facet>
        <a:column headerText="Name">
            <h:outputText value="#{document.name}" />
        </a:column>
        <a:column headerText="Size">
            <h:outputText value="#{document.size}" />
        </a:column>
        <a:column headerText="Type">
            <h:outputText value="#{document.type}" />
        </a:column>
    </a:treeTable>

    <a:commandButton value="Display" update="msgs" icon="ui-icon-newwin"
                        actionListener="#{ttSelectionView.displaySelectedMultiple(ttSelectionView.selectedNodes2)}"/>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.