Chapter 11. Panels

This chapter details those components which act as panels and containers to hold groups of other components.

11.1. <rich:panel>

The <rich:panel> component is a bordered panel with an optional header.
<rich:panel>

Figure 11.1. <rich:panel>

11.1.1. Basic usage

No attributes need to be listed for basic usage. a <rich:panel> without any attributes defined renders a bordered region with no header.

11.1.2. Adding a header

To add a header to the panel, use the header attribute to specify the text to appear in the header. Alternatively the header can be constructed using a header facet. Example 11.1, “Adding a header” demonstrates the two different approaches.

Example 11.1. Adding a header

<rich:panel header="This is the panel header">
    <h:outputText value="This is the panel content" />
</rich:panel>
<rich:panel>
    <f:facet name="header">
        <h:outputText value="This is the panel header">
    </f:facet>
    <h:outputText value="This is the panel content" />
</rich:panel>
Both the examples render an identical panel.
Adding a header

Figure 11.2. Adding a header

11.1.3. Reference data

  • component-type: org.richfaces.Panel
  • component-class: org.richfaces.component.UIPanel
  • component-family: org.richfaces.Panel
  • renderer-type: org.richfaces.PanelRenderer

11.1.4. Style classes and skin parameters

Table 11.1. Style classes (selectors) and corresponding skin parameters

Class (selector) Skin Parameters Mapped CSS properties
.rf-p
This class defines styles for the panel itself.
generalBackgroundColor
background-color
panelBorderColor
color
.rf-p-hdr
This class defines styles for the header of a panel.
headerBackgroundColor
background-color, border-color
headerTextColor
color
headerSizeFont
font-size
headerWeightFont
font-weight
headerFamilyFont
font-family
.rf-p-b
This class defines styles for the body of a panel.
generalTextColor
color
generalSizeFont
font-size
generalFamilyFont
font-family