The rich:contextMenu component provides hierarchical context menu systems similar to those found in many desktop applications.

The context menu is invisable until triggered by a user action on the parent object. In this example, the context menu is displayed when one right-clicks on the image.

Much like drop-down menus, context menus can contain a set of rich:menuItem components, rich:menuGroup components, and rich:menuSeparator components. Menu groups are used for secondary levels on the menu. Menu separators are represented with horizontal lines between items or groups. Menu items are active elements that might produce Ajax or non-Ajax requests. The submission mode is defined with mode attribute, which has three possible options: server, ajax, or client. The client mode does not submit a request, but allows you to provide your own functionality inside the menu item with any in-line content. The mode attribute can be over-ridden in child items.