JBoss.orgCommunity Documentation

Chapter 9. Panels

9.1. <r:panel>
9.1.1. Basic usage
9.1.2. Adding a header
9.1.3. Reference data
9.1.4. Style classes and skin parameters
9.2. <r:accordion>
9.2.1. Basic usage
9.2.2. Switching panels
9.2.3. <r:accordion> client-side events
9.2.4. <r:accordion> server-side events
9.2.5. JavaScript API
9.2.6. Reference data
9.2.7. Style classes and skin parameters
9.2.8. <r:accordionItem>
9.3. <r:collapsiblePanel>
9.3.1. Basic usage
9.3.2. Expanding and collapsing the panel
9.3.3. Appearance
9.3.4. <r:collapsiblePanel> server-side events
9.3.5. JavaScript API
9.3.6. Reference data
9.3.7. Style classes and skin parameters
9.3.8. <r:panelToggleListener>
9.4. <r:popupPanel>
9.4.1. Basic usage
9.4.2. Showing and hiding the pop-up
9.4.3. Modal and non-modal panels
9.4.4. Size and positioning
9.4.5. Header and controls
9.4.6. Contents of the pop-up
9.4.7. JavaScript API
9.4.8. Reference data
9.4.9. Style classes and skin parameters
9.5. <r:tabPanel>
9.5.1. Switching panels
9.5.2. <r:tabPanel> client-side events
9.5.3. <r:tabPanel> server-side events
9.5.4. JavaScript API
9.5.5. Reference data
9.5.6. Style classes and skin parameters
9.5.7. <r:tab>
9.6. <r:togglePanel>
9.6.1. Basic usage
9.6.2. Dynamic panel item generation
9.6.3. Toggling between components
9.6.4. JavaScript API
9.6.5. Reference data
9.6.6. <r:itemChangeListener>
9.6.7. <r:toggleControl>
9.6.8. <r:togglePanelItem>

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

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


The <r:accordion> is a series of panels stacked on top of each other, each collapsed such that only the header of the panel is showing. When the header of a panel is clicked, it is expanded to show the content of the panel. Clicking on a different header will collapse the previous panel and epand the selected one. Each panel contained in a <r:accordion> component is a <r:accordionItem> component.


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

Class (selector)Skin ParametersMapped CSS properties
.rf-ac
This class defines styles for the accordion control itself.

panelBorderColor

border-color

generalBackgroundColor

background

.rf-ac-itm-hdr
This class defines styles for the header of an accordion item.

panelBorderColor

border-bottom-color

headerBackgroundColor

background-color

headerTextColor

color

headerWeightFont

font-weight

headerFamilyFont

font-family

headerSizeFont

font-size

.rf-ac-itm-hdr-act
.rf-ac-itm-hdr-inact:: These classes define styles for the header when the item is either active (expanded) or inactive (collapsed).

No skin parameters.

.rf-ac-itm-hdr-dis
This class defines styles for the header when it is disabled.

tabDisabledTextColor

color

.rf-ac-itm-gr
This class defines styles for an item group.

No skin parameters.

.rf-ac-itm-cnt
This class defines styles for the content of an accordion item.

panelBorderColor

border-bottom-color

generalTextColor

color

generalFamilyFont

font-family

generalSizeFont

font-size

.rf-ac-itm-ico
This class defines styles for the item icon.

No skin parameters.

.rf-ac-itm-exp-ico
This class defines styles for the expanded icon for an item.

No skin parameters.

.rf-ac-itm-ico-act
.rf-ac-itm-ico-inact:: These classes define styles for the icon when the item is either active (expanded) or inactive (collapsed).

No skin parameters.

.rf-ac-itm-lbl
This class defines styles for the item label.

No skin parameters.

.rf-ac-itm-lbl-act
.rf-ac-itm-lbl-inact:: These classes define styles for the label when the item is either active (expanded) or inactive (collapsed).

No skin parameters.


The <r:collapsiblePanel> component is a collapsible panel that shows or hides content when the header bar is activated. It is a simplified version of <r:togglePanel> component.


The <r:popupPanel> component provides a pop-up panel or window that appears in front of the rest of the application. The <r:popupPanel> component functions either as a modal window which blocks interaction with the rest of the application while active, or as a non-modal window. It can be positioned on the screen, dragged to a new position by the user, and re-sized.

If show="true" then the pop-up panel will display when the page is first loaded.

The <r:popupPanel> component can be shown and hidden manually using the show() and hide() methods from the JavaScript API. These can be implemented using two different approaches:

For explicit referencing when using the functions, the component can be given an id identifier.

Example 9.2, “<r:popupPanel> example” demonstrates basic use of both the <r:componentControl> component and the r:component function to show and hide the <r:popupPanel> component.


Placement

The <r:popupPanel> component is usually rendered in front of any other objects on the page. This is achieved by attaching the component to the <body> element of the page, and setting a very high "z-index" (the stack order of the object). This approach is taken because relatively-positioned elements could still overlap the pop-up panel if they exist at higher levels of the DOM hierarchy, even if their z-index is less than the <r:popupPanel> component.

If the <r:popupPanel> is to participate in submitting child components/behaviors, then a form element must be nested within the <r:popupPanel>. Alternatively, if no overlapping elements exist, the <r:popupPanel> component can be reattached to its original DOM element by setting domElementAttachment to either parent or form.

The <r:tabPanel> component provides a set of tabbed panels for displaying one panel of content at a time. The tabs can be highly customized and themed. Each tab within a <r:tabPanel> container is a <r:tab> component. Refer to Section 9.5.7, “<r:tab>” for further details on the <r:tab> component.


Form elements required

All <r:tabPanel> components should be wrapped in a form element when using either ajax or server mode, as usual for submitting components.

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

Class (selector)Skin ParametersMapped CSS properties
.rf-tab-hdr
This class defines styles for a tab header.

panelBorderColor

border

tabBackgroundColor

background-color

generalTextColor

color

.rf-tab-hdr-act
This class defines styles for a tab header when it is active.

additionalBackgroundColor

background-color

.rf-tab-hdr-inact
This class defines styles for a tab header when it is inactive.

No skin parameters.

.rf-tab-hdr-dis
This class defines styles for a tab header when it is disabled.

tabDisabledTextColor

color

.rf-tab-hdr-tabline-vis
This class defines styles for the header tab line when it is visible.

additionalBackgroundColor

background-color

panelBorderColor

border-color

.rf-tab-hdr-tabs
This class defines styles for the tabs in the header.

No skin parameters.

.rf-tab-hdr-spcr
This class defines styles for the tab header spacer.

panelBorderColor

border-bottom

.rf-tab-lbl
This class defines styles for the tab label.

generalFamilyFont

font-family

generalSizeFont

font-size

.rf-tab-hdn
This class defines styles for the tab when it is hidden.

No skin parameters.

.rf-tab-hdr-scrl-lft
.rf-tab-hdr-scrl-rgh:: These classes define styles for the left and right controls for the tab header scroller.

additionalBackgroundColor

background

panelBorderColor

border

generalFamilyFont

font-family

generalSizeFont

font-size

.rf-tab-hdr-tablst
This class define styles for the tab header list.

additionalBackgroundColor

background

panelBorderColor

border

generalFamilyFont

font-family

.rf-tab-hdr-brd
This class define styles for the tab header border.

tabBackgroundColor

background

panelBorderColor

border

.rf-tab-cnt
This class define styles for the content of the tab panel.

generalBackgroundColor

background

panelBorderColor

border

generalFamilyFont

font-family

generalSizeFont

font-size


The <r:tab> component represents an individual tab inside a <r:tabPanel> component, including the tab’s content. Clicking on the tab header will bring its corresponding content to the front of other tabs.

The <r:togglePanel> component is used as a base for the other switchable components, the <r:accordion> component and the <r:tabPanel> component. It provides an abstract switchable component without any associated markup. As such, the <r:togglePanel> component could be customized to provide a switchable component when neither an accordion component or a tab panel component is appropriate.

The <r:togglePanel> component acts as a wrapper for multiple <r:togglePanelItem> components. Each child component is displayed after being activated with the <r:toggleControl> behavior.

Refer to Section 9.6.7, “<r:toggleControl>” and Section 9.6, “<r:togglePanel>” for details on how to use the components together.

The <r:toggleControl> behavior can be attached to any interface component, whether inside or outside the controlled panel itself. It works with a <r:togglePanel> component to switch between different <r:togglePanelItem> components. Refer to Section 9.6, “<r:togglePanel>” and Section 9.6.8, “<r:togglePanelItem>” for details on how to use the components together.

The <r:toggleControl> implements the JSF BehaviorHolder component, which provides events to attached components and behaviors.

The <r:toggleControl> component can switch the attached <r:togglePanel> component in multiple ways:


  • The next item to switch to can be explicitly defined by including a <r:toggleControl> component within a <r:togglePanelItem> component. Point the targetItem to the <r:togglePanelItem> to switch to when the state is next changed.

  • Alternatively, use the targetItem attribute with keywords to switch items. The @first, @prev, @next, and @last keywords switch to the first item, the previous item, the next item, and the last item respectively.