O'Reilly logo

PrimeFaces Cookbook by Mert Çalışkan, Oleg Varaksin

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

Dock menu for Mac OS fans

The PrimeFaces dock menu transforms images into a Mac-like dock menu, with icons that expand on rollover. Thus, the Dock component mimics the well-known dock interface of Mac OS X. The component consists of menu items and can be built declaratively or programmatically by model.

In this recipe we will develop a dock menu with social media icons.

How to do it...

Menu items should be direct children of p:dockMenu. We will take advantage of the url attribute, which is # in this sample, but represents a valid URL in the real world.

<p:dock id="dock" position="bottom"> <p:menuitem value="Digg" icon="/resources/images/dock/digg.png" url="#"/> <p:menuitem value="Facebook" icon="/resources/images/dock/facebook.png" url="#"/> <p:menuitem ...

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