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.7.1.  < rich:dragIndicator > available since 3.0.0

This is a component for defining what appears under the mouse cursor during drag-and-drop operations. The displayed drag indicator can show information about the dragged elements.

Table 6.133. rich : dragIndicator attributes

Attribute Name Description
acceptClassAssigns one or more space-separated CSS class names to the indicator which are applied when a drop is accepted
binding JSF: The attribute takes a value-binding expression for a component property of a backing bean
id JSF: Every component may have a unique id that is automatically created if omitted
rejectClassAssigns one or more space-separated CSS class names to the indicator which are applied when a drop is rejected
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 space-separated CSS class names to the component. Corresponds to the HTML "class" attribute.

Table 6.134. Component identification parameters


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


<rich:dragIndicator  id="indicator">
        <f:facet name="single">
                    <b>Single item</b> {DragInfo}
<rich:dragSupport dragType="text" dragIndicator="indicator"/>


import org.richfaces.component.html.HtmlDragIndicator;

HtmlDragIndicator myDragIndicator = new HtmlDragIndicator();

In the simplest way the component could be defined empty - in that case a default indicator is shown like this:

For indicator customization you need to define one of the following facets:

  • "single" — indicator shown when dragging a single item;

  • "multiple" — indicator shown when dragging several items.


The current implementation of the <rich:dragIndicator> component does not support multiple items selection. The feature is described for future releases.

Thus for specify a look-and-feel you have to define one of these facets and include into it a content that should be shown in indicator.

The <rich:dragIndicator> component has no skin parameters and special style classes , as it consists of one element generated with a your method on the server. To define some style properties such as an indent or a border, it's possible to use "style" and "styleClass" attributes on the component.

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