11.3. <rich:collapsiblePanel>
The
<rich:collapsiblePanel> component is a collapsible panel that shows or hides content when the header bar is activated. It is a simplified version of <rich:togglePanel> component.
11.3.1. Basic usage
Basic usage requires the header content is specified either by the
header attribute, or by the headerExpanded/headerCollapsed facets. Additionally the panel requires content to display when it is expanded. Content is added as child elements like a standard panel.
11.3.2. Expanding and collapsing the panel
The switching mode for performing submissions is determined by the
switchType attribute, which can have one of the following three values:
server- This is the default setting. The
<rich:collapsiblePanel>component performs a common submission, completely refreshing the page. Only one panel at a time is rendered to the client side. ajax- The
<rich:collapsiblePanel>component performs an Ajax form submission, and only the content of the panel is refreshed. Only one panel at a time is rendered to the client side. client- The
<rich:collapsiblePanel>component changes the state on the client side without any additional requests being sent.
11.3.3. Appearance
The appearance of the
<rich:collapsiblePanel> component can be customized using facets. The headerExpanded and headerCollapsed CSS fclasses are used to style the appearance of the panel when it is expanded and collapsed respectively.
11.3.4. <rich:collapsiblePanel> server-side events
The
<rich:collapsiblePanel> component uses the following unique server-side events:
- The
PanelToggleEventevent occurs on the server side when the<rich:collapsiblePanel>component is expanded or collapsed in either theajaxorservermodes. It can be processed using thepanelTogglerListenerattribute.
11.3.5. JavaScript API
The
<rich:collapsiblePanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions:
switchPanel()- Switch the state of the collapsible panel (expanded or collapsed).
11.3.6. Reference data
component-type:org.richfaces.CollapsiblePanelcomponent-class:org.richfaces.component.UICollapsiblePanelcomponent-family:org.richfaces.CollapsiblePanelrenderer-type:org.richfaces.CollapsiblePanelRendererhandler-class:org.richfaces.view.facelets.html.CollapsiblePanelTagHandler
11.3.7. Style classes and skin parameters
Table 11.3. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties |
|---|---|---|
| panelBorderColor
|
color
|
generalBackgroundColor
|
background
| |
| headerBackgroundColor
|
background-color, border-color
|
headerTextColor
|
color
| |
headerWeightFont
|
font-weight
| |
headerFamilyFont
|
font-family
| |
headerSizeFont
|
font-size
| |
| No skin parameters. | |
| No skin parameters. | |
| generalTextColor
|
color
|
generalFamilyFont
|
font-family
| |
generalSizeFont
|
font-size
| |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
11.3.8. <rich:panelToggleListener>
Use the
<rich:panelToggleListener> tag to register a PanelToggleListener class on a parent <rich:collapsiblePanel> component. The class provided as a listener must implement the org.richfaces.event.PanelToggleListener interface. The processPanelToggle method accepts an org.richface.event.PanelToggleEvent event as a parameter.
