Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:47:08+00:00 2026-05-23T14:47:08+00:00

In my application, I have a tree with various object types (sources, tables, etc).

  • 0

In my application, I have a tree with various object types (sources, tables, etc).
I’d like to enable a context menu for the different types of object (add, delete, edit etc).

How can I use context menu on tree nodes in Primefaces ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:47:09+00:00Added an answer on May 23, 2026 at 2:47 pm

    Never did it in practice (I am still on Primefaces 2.x), but from theory the facelet code should look something like this:

    <h:form>
      <p:tree value="#{myBean.tree}" var="node" id="tree"
              selectionMode="single" selection="#{myBean.selectedNode}">
         <p:treeNode>
            <h:outputText value="#{node}" />
         </p:treeNode>
      </p:tree>
    
      <p:contextMenu for="tree" id="menu">
        <p:menuitem value="Add" actionListener="#{myBean.add}" />
         ...
      </p:contextMenu>
    </h:form>
    

    Usage of p:contextMenu and p:tree is shown in Primefaces showcase.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object tree which is included in a ResourceDictionary in my application.
I have an object tree that looks something like Ball / \ LegalBall IllegalBall
I have a tree representation of pages in a CMS application. I understand how
I have an application where a Hilbert R-Tree (wikipedia) (citeseer) would seem to be
I have a large tree of Java Objects in my Desktop Application and am
I have a web application where I am using asp.net tree view control to
I have a JSF application with several major components and a component tree under
I have content management system application that uses a polymorphic tree table as the
Situation is you have to develop an application against an Active Directory Tree. Want
I have an application which shows a Tree where can select nodes of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.