Accessing commands via menubar

Menubar is a horizontal navigation component with drop-down menus that are displayed on mouseover or on clicking. Menubar features the same common behaviors as every PrimeFaces menu. It consists of (nested) submenus, menu items, and custom content that can be built declaratively or programmatically by modeling.

In this recipe, we will build a declarative menu bar with various commands as nested and direct menu items. The possibility of including any custom content, such as input, select, and button components, will be illustrated as well.

How to do it…

We will create a menu bar as shown in the following screenshot.

How to do it…

In ...

Get PrimeFaces Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.