The multipurpose output panel

The outputPanel component is a panel component that can be rendered as a div or span HTML component. In this recipe, we will create an output panel that demonstrates deferred loading and placeholder usage for a data table.

How to do it…

A basic definition of an output panel would be as follows:

<p:outputPanel layout="block">
  <h3>The Volkswagen CC (also known as the
    Volkswagen Passat CC)</h3>
  <p>is a four-door coupe version of the Volkswagen Passat.</p>
</p:outputPanel>

When the layout attribute is set to block, which is the default value, outputPanel renders an HTML div. By setting layout as inline, we can render an HTML span instead of the div.

There's more…

The outputPanel component supports deferred loading, where the ...

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.