O'Reilly logo

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

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

Simulating the portal environment with dashboard

A layout component, dashboard has the drag-and-drop ability to support reordering of the panels. In this recipe, we will create a dashboard with predefined panels and then add new ones.

How to do it…

A basic definition for a dashboard with six panels would be as follows:

<p:dashboard id="board" model="#{dashboardBean.model}"> <p:ajax event="reorder" listener= "#{dashboardBean.handleReorder}" update="growl" /> <p:panel id="calculator" header="Calculator"> <h:outputText value="Content for Calculator" /> </p:panel> <p:panel id="calendar" header="Calendar"> <h:outputText value="Content for Calendar" /> </p:panel> <p:panel id="contact" header="Contacts"> <h:outputText value="Content for Contacts" /> </p:panel> ...

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