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> ...

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.