JARCH SHOWCASE
JARCH SHOWCASE
TreeTable - ContextMenu ContextMenu has special integration with TreeTable. Even different menus can be assigned to different node types by matching node types.
Document Viewer
NameSizeType
Document Detail
<a:form id="form">

    <a:treeTable id="docs" value="#{ttContextMenuView.root}" var="document" selectionMode="single" selection="#{ttContextMenuView.selectedNode}">
        <f:facet name="header">
            Document Viewer
        </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:contextMenu for="docs">
        <a:menuitem value="View" update="documentPanel" icon="ui-icon-search" oncomplete="PF('documentDialog').show()"/>
        <a:menuitem value="Delete" actionListener="#{ttContextMenuView.deleteNode}" update="docs" icon="ui-icon-close"/>
    </a:contextMenu>

    <a:dialog id="dialog" header="Document Detail" showEffect="fade" widgetVar="documentDialog" modal="true" resizable="false">
        <a:outputPanel id="documentPanel">
            <a:panelGrid  columns="2" columnClasses="label,value" rendered="#{not empty ttContextMenuView.selectedNode}">
                <h:outputLabel for="name" value="Name: " />
                <h:outputText id="name" value="#{ttContextMenuView.selectedNode.data.name}" style="font-weight:bold" />

                <h:outputLabel for="size" value="Size: " />
                <h:outputText id="size" value="#{ttContextMenuView.selectedNode.data.size}" style="font-weight:bold" />

                <h:outputLabel for="type" value="Type " />
                <h:outputText id="type" value="#{ttContextMenuView.selectedNode.data.type}" style="font-weight:bold" />
            </a:panelGrid>
        </a:outputPanel>
    </a:dialog>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.