bar rich:panelbar HtmlPanelBar

Component identification parameters

Name | Value
--- | ---
component-type | org.richfaces.PanelBar
component-class | org.richfaces.component.html.HtmlPanelBar
component-family | org.richfaces.PanelBar
renderer-type | org.richfaces.PanelBarRenderer
tag-class | org.richfaces.taglib.PanelBarTag

## Creating the Component with a Page Tag

Here is a simple example as it could be used on a page:

Example:

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

## Creating the Component Dynamically Using Java

Example:

    import org.richfaces.component.html.HtmlPanelBar;
    ...
    HtmlPanelBar myBar = new HtmlPanelBar();
    ...

## Details of Usage

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.

## Look-and-Feel Customization

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:

- Redefine the corresponding skin parameters

- Add to your style sheets style classes used by a <rich:panelBar> component

## Skin Parameters Redefinition

Skin parameter redefinition for a whole component

Skin parameter | CSS properties
--- | ---
headerBackgroundColor | border-color

## Definition of Custom Style Classes

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

Style class

Class name that define a component appearance

Class name | Class description
--- | ---
rich-panelbar | Defines styles for a wrapper <div> element of a component

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

Style component classes

A class attribute | A component element defined by an attribute
--- | ---
styleClass | Applicable to a whole component (together with headers)
headerClass | Applicable to a header element
contentClass | Applicable to a content

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 and define necessary properties in them.

To change styles of particular <rich:panelBar> components, define your own style classes in the corresponding <rich:panelBar> attributes.

CSS code piece used on a page:

Example:

    ...
        . rich-panelbar{
            padding:10px;
        }
        .myClass{
            font-style:italic;
        }
    ...

When using headerClass and headerClassActive attributes the declaration of headerClass should precede the one of headerClassActive:

Example:

    ...
        .headerClass{
            ...
        }
        .headerClassActive{
            ...
        }
    ...

The component is defined in the following way:

Example:

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

Hence, padding for all <rich:panelBar> is changed on a page as well as a font for particular <rich:panelBarItem> content.

## Relevant Resources Links

Here you can see the example of <rich:panelBar> usage and sources for the given example.