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
dragSourceidentifies the component being dragged (the parent of the<rich:dragSource>component). - The
dragValueparameter is the content of the<rich:dragSource>component'sdragValueattribute. - The
dropValueparameter is the content of the<rich:dropTarget>component'sdropValueattribute.
16.2.3. Reference data
component-type:org.richfaces.DropTargetcomponent-class:org.richfaces.component.UIDropTargetcomponent-family:org.richfaces.DropTargetrenderer-type:org.richfaces.DropTargetRendererhandler-class:org.richfaces.view.facelets.DropHandler