Skip to end of metadata
Go to start of metadata
Table of contents

Scope

ComponentBackground | componentJavadoc=Panel

Background

A Panel is a reusable component that holds markup and other components. If you want to reuse a component without copying its markup into each page markup, extend the class Panel:

You can use Markup inheritance with Panels too.

See Panels and borders to see the difference between Panels and Borders and Fragment to see how to use 'in-line' panels.

Panels can be used to create dynamic markup hierarchies.

FAQ

Examples

Typical usage

UserPanel.java:

UserPanel.html:

That's for your reusable panel, which you can now use anywhere like:

and:

or for better previewability:

Advanced example using a ListView

UsersListPanel.java:

UsersListPanel.html:

That's for your reusable panel, which you can now use anywhere like:

and:

or for better previewability: