JBoss.orgCommunity Documentation

6.40.  < rich:dragIndicator >

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.152. rich : dragIndicator attributes

Attribute NameDescription
acceptClassCorresponds to the HTML class attribute and added to an indicator when a drop is accepted
bindingThe attribute takes a value-binding expression for a component property of a backing bean
idEvery component may have a unique id that is automatically created if omitted
rejectClassCorresponds to the HTML class attribute and added to an indicator when a drop is rejected
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

Table 6.153. Component identification parameters

NameValue
component-typeorg.richfaces.Draggable
component-classorg.richfaces.component.html.HtmlDragIndicator
component-familyorg.richfaces.DragIndicator
renderer-typeorg.richfaces.DragIndicatorRenderer
tag-classorg.richfaces.taglib.DragIndicatorTag

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

Example:


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

Example:

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

  • "multiple"

Indicator shown when dragging several components (for future components that will support multiple selection).

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.

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