Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.0.0)

E17491-02

<af:dropTarget>

dropTarget drop target


The <af:dropTarget> tag provides generic drop support for components that don't show any location-specific drop feedback. If the drop action matches any of the DataFlavors specified by the enclosed <af:dataFlavor> tags and the proposed drop action matches one of the actions then the dropListener's javax.el.MethodExpression will be called with the DropEvent. The af:dropTarget tag must have at minimum one af:dataFlavor child tag.

</section> <section name="Code_Example_s_">

This example shows setting the actions, and dropListener attribute of the <af:dropTarget> tag as well as using the <af:dataFlavor> tag to support drops of java.util.Collection objects onto the outputText, firing the handleCollectionFireDrop method on the TestDropHandler managed bean.


  <af:outputText id="objectDropTarget" value="Fire these developers:">
    <af:dropTarget actions="COPY" 
                  dropListener="#{TestDropHandler.handleCollectionFireDrop}">
      <af:dataFlavor flavorClass="java.util.Collection"/>
    </af:dropTarget>
  </af:outputText>
            

Attributes

Name Type Supports EL? Description
actions String no Drag and drop actions supported by this target. The actions must be an NMTOKENS from the set of "COPY, "MOVE", "LINK" in any particular order e.g. (actions="COPY LINK MOVE"). If no actions are specified, the default is "COPY".
clientDropListener String no JavaScript method taking no parameters that will be called when an item is dropped on the dropTarget. The JavaScript method can perform client side processing related to the operation before a server call is made. This method returns an AdfDnDContext action. For example, if the method returns AdfDnDContext.ACTION_NONE the drop operation will be canceled and no server call will be made; if the method returns AdfDnDContext.ACTION_COPY a copy operation will be allowed and a server call will be made which will execute the dropListener if it exists.
dropListener javax.faces.el.MethodBinding Only EL A method reference to a callback with the signature oracle.adf.view.rich.dnd.DnDAction method(oracle.adf.view.rich.event.DropEvent dropEvent) called when a drop occurs on the component. This callback should check the DropEvent to determine whether it will accept the drop or not. If the callback accepts the drop, it should perform the drop and return the DnDAction it performed-- DnDAction.COPY, DnDAction.MOVE or DnDAction.LINK, otherwise it should return DnDAction.NONE to indicate that the drop was rejected. The target component is automatically redrawn in response to a successful drop.