6.74.  < rich:separator >

6.74.1. Description

A horizontal line to use as a separator in a layout. The line type can be customized with the "lineType" parameter.

<rich:separator> component

Figure 6.206.  <rich:separator> component


6.74.2. Key Features

  • Highly customizable look and feel

  • Leveraging layout elements creation

Table 6.413. rich : separator attributes

Attribute NameDescription
alignleft|center|right [CI] This attribute specifies a position of the separator according to the document. Permitted values: * left: The separator is to the left of the document. * center: The separator is to the center of the document. * right: The separator is to the right of the document
bindingThe attribute takes a value-binding expression for a component property of a backing bean
heightThe separator height. Default value is 6 pixels
idEvery component may have a unique id that is automatically created if omitted
lineTypeA line type. The possible values are beveled (default), dotted, dashed, double and solid
onclickHTML: a script expression; a pointer button is clicked
ondblclickHTML: a script expression; a pointer button is double-clicked
onkeydownHTML: a script expression; a key is pressed down
onkeypressHTML: a script expression; a key is pressed and released
onkeyupHTML: a script expression; a key is released
onmousedownHTML: script expression; a pointer button is pressed down
onmousemoveHTML: a script expression; a pointer is moved within
onmouseoutHTML: a script expression; a pointer is moved away
onmouseoverHTML: a script expression; a pointer is moved onto
onmouseupHTML: script expression; a pointer button is released
renderedIf "false", this component is not rendered
styleCSS style(s) is/are to be applied when this component is rendered
styleClassCorresponds to the HTML class attribute
titleHTML: An advisory title for this element. Often displayed as a tooltip
widthThe separator width that can be defined in pixels or in percents. The default value is 100%

Table 6.414. Component identification parameters

NameValue
component-typeorg.richfaces.separator
component-classorg.richfaces.component.html.HtmlSeparator
component-familyorg.richfaces.separator
renderer-typeorg.richfaces.SeparatorRenderer
tag-classorg.richfaces.taglib.SeparatorTag

6.74.3. Creating the Component with a Page Tag

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

Example:


...
    <rich:separator/>
...

6.74.4. Creating the Component Dynamically Using Java

Example:


import org.richfaces.component.html.HtmlSeparator;
...
HtmlSeparator mySeparator = new HtmlSeparator();
...

6.74.5. Details of Usage

<rich:separator> is a simple layout component which represents a separator stylized as a skin. Thus, the main attributes that define its style are "style" and "styleClass". In addition there are width and height attributes that should be specified in pixels.

The line type can be customized with the "lineType" parameter. For example, different line types are shown after rendering with the following initial settings lineType="double" and "lineType="solid".

Different line types of <rich:separator>

Figure 6.207. Different line types of <rich:separator>


Except style attributes, there are also event definition attributes.

  • onmouseover

  • onclick

  • onmouseout

  • etc.

6.74.6. Look-and-Feel Customization

For skinnability implementation, the components use a style class redefinition method.

To redefine the appearance of all <rich:separator> components at once, you should add to your style sheets the style class used by a <rich:separator> component.

6.74.7. Definition of Custom Style Classes

Table 6.415. Classes names that define a component appearance

Class nameDescription
rich-separatorDefines styles for a component appearance

In order to redefine styles for all <rich:separator> 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-separator{
    
background-color:#ff7700;
}
...

This is a result:

Redefinition styles with predefined classes

Figure 6.208. Redefinition styles with predefined classes


In the example background color for separator was changed.

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

Example:


...
.myClass{
    
background-color:#ffead9;
}
...

The "styleClass" attribute for <rich:separator> is defined as it’s shown in the example below:

Example:


<rich:separator ... styleClass="myClass"/>

This is a result:

Redefinition styles with own classes and styleClass attributes

Figure 6.209. Redefinition styles with own classes and styleClass attributes


As it could be seen on the picture above,background color for separator was changed.

6.74.8. Relevant Resources Links

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