16.2. <rich:dropTarget>

The <rich:dropTarget> component can be added to a component so that the component can accept dragged items. The dragged items must be defined with a compatible drop type for the <rich:dragSource> component.

16.2.1. Basic usage

To allow dragged items to be dropped on a component, attach the <rich:dropTarget> component as a child element to the component.
The acceptedTypes attribute must be specified. The acceptedTypes attribute is a comma-separated list of strings that match the types of dragged items. Dragged items can only be dropped in drop zones where the type attribute of the <rich:dragSource> component is listed in the acceptedTypes attribute of the <rich:dropTarget> component.
The acceptedTypes attribute can optionally be set to either @none or @all. If set to @none, the component will not accept any type of dropped object. If set to @all, the component accepts all dropped objects. If the acceptedTypes attribute is not specified, the default value is null, which is the same as a @none setting.

16.2.2. Handling dropped data

To provide additional parameters for the server-side drop event, use the dropValue attribute.
The <rich:dropTarget> component raises the DropEvent server-side event when an object is dropped. The event uses the following parameters:
  • The dragSource identifies the component being dragged (the parent of the <rich:dragSource> component).
  • The dragValue parameter is the content of the <rich:dragSource> component's dragValue attribute.
  • The dropValue parameter is the content of the <rich:dropTarget> component's dropValue attribute.

16.2.3. Reference data

  • component-type: org.richfaces.DropTarget
  • component-class: org.richfaces.component.UIDropTarget
  • component-family: org.richfaces.DropTarget
  • renderer-type: org.richfaces.DropTargetRenderer
  • handler-class: org.richfaces.view.facelets.DropHandler

16.2.4. Style classes

Style classes (selectors)

.rf-drp-hvr
This class defines styles for the drop target when a dragged item is hovering over it.
.rf-drp-hlight
This class defines styles for a highlighted drop target.