O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing ContextMenu

The ContextMenu component can be used to display an overlay menu on the mouse's right-click event. Optionally, we can attach ContextMenu to any JSF component and contain nested submenus and menuitems. If you don't specify any particular JSF component, ContextMenu will be attached to the entire page, meaning right-clicking anywhere on the page will display the same ContextMenu.

The ContextMenu component provides the following attributes to customize its behavior:

  • for: ID of the component to attach to.
  • event: Event to bind the ContextMenu display, default is contextmenu, which means right-click.
  • model: The MenuModel instance to create menu programmatically.
  • nodeType: Specific type of Tree nodes to attach to.
  • beforeShow: Client-side ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required