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.87.  < rich:spacer >

A spacer that is used in layout and rendered as a transparent image.


Table 6.528. rich : spacer attributes

Attribute NameDescription
bindingThe attribute takes a value-binding expression for a component property of a backing bean
heightThe height of the spacer defined in pixels. Default value is "1px".
idEvery component may have a unique id that is automatically created if omitted
onclickThe clientside script method to be called when the element is clicked
ondblclickThe client side script method to be called when the element is double-clicked
onkeydownThe client side script method to be called when a key is pressed down over the element
onkeypressThe client side script method to be called when a key is pressed over the element and released
onkeyupThe client side script method to be called when a key is released
onmousedownThe client side script method to be called when a mouse button is pressed down over the element
onmousemoveThe client side script method to be called when a pointer is moved within the element
onmouseoutThe client side script method to be called when a pointer is moved away from the element
onmouseoverThe client side script method to be called when a pointer is moved onto the element
onmouseupThe client side script method to be called when a mouse 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 used by the user agent as a tooltip
widthThe width of the spacer defined in pixels. Default value is "1px".

Table 6.529. Component identification parameters

NameValue
component-typeorg.richfaces.spacer
component-classorg.richfaces.component.html.HtmlSpacer
component-familyorg.richfaces.spacer
renderer-typeorg.richfaces.SpacerRenderer
tag-classorg.richfaces.taglib.SpacerTag

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

Example:


...
    <rich:spacer/>
...

Example:

import org.richfaces.component.html.HtmlSpacer;

...
HtmlSpacer mySpacer = new HtmlSpacer();
...

<rich:spacer> is a simple layout component which represents a transparent spacer. Thus, the main attributes that define its style are "style" and "styleClass".

In addition, the attributes are responsible for the component size: "width" and "height".

Moreover, to add e.g. some JavaScript effects, events defined on it are used.

On the component generation, the framework presents a default rich-spacer class in "styleClass" of a generated component, i.e. in order to redefine appearance of all spacers at once, it's necessary to redefine this class in your own CSS (replacing in the result properties defined in a skin with your own).

To define appearance of the particular spacer, it's possible to write your own CSS classes and properties in the component style attributes ( "style", "styleClass" ) modifying component property.

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