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.10.10.  < rich:separator > available since 3.0.0

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


Table 6.269. rich : separator attributes

Attribute Name Description
alignThis attribute specifies a position of the separator according to the document. The possible values are "left", "center" and "right". Default value is "left".
binding JSF: The attribute takes a value-binding expression for a component property of a backing bean
heightThe separator height. Default value is "6px".
id JSF: Every component may have a unique id that is automatically created if omitted
lineTypeA line type. The possible values are "beveled", "dotted", "dashed", "double", "solid" and "none". Default value is "beveled"
onclick DHTML: The client-side script method to be called when the element is clicked
ondblclick DHTML: The client-side script method to be called when the element is double-clicked
onkeydown DHTML: The client-side script method to be called when a key is pressed down over the element
onkeypress DHTML: The client-side script method to be called when a key is pressed over the element and released
onkeyup DHTML: The client-side script method to be called when a key is released
onmousedown DHTML: The client-side script method to be called when a mouse button is pressed down over the element
onmousemove DHTML: The client-side script method to be called when a pointer is moved within the element
onmouseout DHTML: The client-side script method to be called when a pointer is moved away from the element
onmouseover DHTML: The client-side script method to be called when a pointer is moved onto the element
onmouseup DHTML: The client-side script method to be called when a mouse button is released
rendered JSF: If "false", this component is not rendered
styleHTML: CSS style rules to be applied to the component
styleClass JSF: Assigns one or more CSS class names to the component. Corresponds to the HTML "class" attribute.
titleHTML: HTML: An advisory title for this element. Often displayed as a tooltip
widthHTML: The separator width that can be defined in pixels or in percents. Default value is "100%".

Table 6.270. 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

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

Example:


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

Example:

import org.richfaces.component.html.HtmlSeparator;

...
HtmlSeparator mySeparator = new HtmlSeparator();
...

<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. On the HTML page the component is transposed into HTML <div> tag.

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".


Except style attributes, there are also event definition attributes:

  • "onmouseover"

  • "onclick"

  • "onmouseout"

  • etc.

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.


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:


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:


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

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