Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.77.  < rich:panelBar >

panelBar is used for grouping any content which is loaded on the client side and appears as groups divided on child panels after the header is clicked.


Table 6.434. rich : panelBar attributes

Attribute NameDescription
bindingThe attribute takes a value-binding expression for a component property of a backing bean
contentClassThe component content style class
contentStyleThe component content style
headerClassThe component header style class
headerClassActiveThe component header style class active
headerStyleThe component header style
headerStyleActiveThe component header style active
heightThe height of the slide panel. Might be defined as pixels or as percentage. Default value is "100%".
idEvery component may have a unique id that is automatically created if omitted
immediateA flag indicating that this component value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until a Process Validations phase
onclickHTML: script expression; before on the header is clicked
onitemchangeHTML: script expression; a item is changed
onmousemoveHTML: a script expression; a pointer is moved within
onmouseoutHTML: a script expression; a pointer is moved away
onmouseoverHTML: script expression; a pointer was moved onto.
renderedIf "false", this component is not rendered
selectedPanelAttribure defines name of selected item
styleCSS style(s) is/are to be applied when this component is rendered
styleClassCorresponds to the HTML class attribute.
valueThe current value of this component
valueChangeListenerListener for value changes
widthThe width of the slide panel. Might be defined as pixels or as percentage. Default value is "100%".

Table 6.435. Component identification parameters

NameValue
component-typeorg.richfaces.PanelBar
component-classorg.richfaces.component.html.HtmlPanelBar
component-familyorg.richfaces.PanelBar
renderer-typeorg.richfaces.PanelBarRenderer
tag-classorg.richfaces.taglib.PanelBarTag

To create the simplest variant on a page use the following syntax:

Example:


...
    <rich:panelBar>
        <!--//... -->
        <rich:panelBarItem label="Canon">
            ...
        </rich:panelBarItem>
        <rich:panelBarItem label="Nikon">
            ...
        </rich:panelBarItem>
    </rich:panelBar>
...

Example:

import org.richfaces.component.html.HtmlPanelBar;

...
HtmlPanelBar myBar = new HtmlPanelBar();
...

As it was mentioned above, panelBar is used for grouping any content on the client, thus its customization deals only with specification of sizes and styles for rendering.

"width" and "height" (both are 100% on default) attributes stand apart.

Style attributes are described further.

panelBar could contain any number of child panelBarItem components inside, which content is uploaded onto the client and headers are controls to open the corresponding child element.

For skinnability implementation, the components use a style class redefinition method. Default style classes are mapped on skin parameters.

There are two ways to redefine the appearance of all <rich:panelBar> components at once:


There is one predefined class for the <rich:panelBar> , which is applicable to a whole component, specifying padding, borders, and etc.



Other classes responsible for elements rendering are described for child <rich:panelBarItem> elements and could be found in the components chapters.


In order to redefine styles for all <rich:panelBar> components on a page using CSS, it's enough to create classes with the same names (possible classes could be found in the tables above) and define necessary properties in them.

Example:


...
.rich-panelbar{
        
font-style: italic;
}
...

This is a result:


In the example header and content font style was changed.

Also it's possible to change styles of particular <rich:panelBar> component. In this case you should create own style classes and use them in corresponding <rich:panelBar> styleClass attributes. An example is placed below:

Example:


...
.myClass{
       
font-family: Tahoma;
}
...

The "contentClass" attribute for <rich:panelBar> is defined as it's shown in the example below:

Example:


<rich:panelBar ... contentClass="myClass"/>

This is a result:


As it could be seen on the picture above, the font family for content were changed.

On the component LiveDemo page you can see the example of <rich:panelBar> usage and sources for the given example.