Breadcrumb – providing contextual information about page hierarchy

Breadcrumb is a navigation component that provides contextual information about the page hierarchy. It allows users to keep track of their locations within the workflow.

In this recipe, we will develop a simple breadcrumb with a handy configuration attribute.

How to do it…

The breadcrumb component is represented as the p:breadCrumb tag with nested menu items. We will use the same CDI bean as in the Statically and dynamically positioned menus recipe of this chapter. This is shown in the following code:

<p:breadCrumb> <p:menuitem value="PrimeFaces" url="http://primefaces.org"/> <p:menuitem value="jQuery" url="http://jquery.com"/> <p:menuitem value="Yahoo UI" url="http://yuilibrary.com"/> ...

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.