Accessing commands via Menubar

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

In this recipe, we will build a declarative menu bar with various commands as nested and direct menu items.

How to do it...

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

How to do it...

The following complete code listing shows p:menubar with submenus p:submenu and menu items p:menuitem inside. For instance, the submenu Create ...

Get PrimeFaces Cookbook 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.