Book Image

Primefaces Cookbook Second Edition

Book Image

Primefaces Cookbook Second Edition

Overview of this book

Table of Contents (20 chapters)
PrimeFaces Cookbook Second Edition
Credits
Foreword
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 content of the panel is loaded after the page is loaded. The panel renders a loading animation while loading its contents.

By default, content gets loaded after the page load, but by setting deferredMode...