item rich:panelbaritem HtmlPanelBar

Component identification parameters

Name | Value
--- | ---
component-type | org.richfaces.PanelBarItem
component-class | org.richfaces.component.html.HtmlPanelBarItem
component-family | org.richfaces.PanelBarItem
renderer-type | org.richfaces.PanelBarItemRenderer
tag-class | org.richfaces.taglib.PanelBarItemTag

## 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.HtmlPanelBarItem;
    ...
    HtmlPanelBarItem myBarItem = new HtmlPanelBarItem();
    ...

## Details of Usage

The "label" attribute defines text to be represented. If you can use the "label" facet, you can even not use the "label" attribute.

Example:

    ...
        <rich:panelBarItem...>
            <f:facet name="label">
                <h:graphicImage value="/images/img1.gif"/>
            </f:facet>
            ...
            <!--Any Content inside-->
            ...
        </rich:panelBarItem>
    ...

As it was mentioned above, panelBarItem is used for grouping any content inside within one panelBar, thus its customization deals only with specification of sizes and styles for rendering.

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:panelBarItem> components at once:

- Redefine the corresponding skin parameters

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

## Skin Parameters Redefinition

Skin parameters redefinition for a content

Skin parameters | CSS properties
--- | ---
generalTextColor | color
preferableDataSizeFont | font-size
preferableDataFamilyFont | font-family

Skin parameters redefinition for a header element (active or inactive)

Skin parameters | CSS properties
--- | ---
headerTextColor | color
headerBackgroundColor | background-color
headerSizeFont | font-size
headerWeightFont | font-weight
headerFamilyFont | font-family

## Definition of Custom Style Classes

On the screenshot there are classes names that define styles for component elements.

Style classes

Classes names that define a component appearance

Class name | Class description
--- | ---
rich-panelbar-header | Defines styles for a wrapper <div> element of a header element
rich-panelbar-header-act | Defines styles for a wrapper <div> element of an active header element
rich-panelbar-content | Defines styles for a content

Style component classes

A class attribute | A component element defined by an attribute
--- | ---
headerClass | Applicable to a header element
contentClass | Applicable to a content

In order to redefine styles for all <rich:panelBarItem> 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:panelBarItem> components, define your own style classes in the corresponding <rich:panelBarItem> attributes.

CSS code piece used on a page:

Example:

    ...
        .rich-panelbar-header{
            font-size:14px;
        }
        .myClass{
            font-style:italic;
        }
    ...

The component is defined in the following way:

Example:

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

Hence, a font size of all <rich:panelBarItem> headers is changed on a page as well as a font for the particular <rich:panelBarItem> content.