CL_DRAGDROP - Behavior for Drag and Drop
CL_GUI_FRONTEND_SERVICES - Frontend Services CPI1466 during BackupThis documentation is copyright by SAP AG.
Functionality
The class CL_DRAGDROP is used to describe the Drag & Drop attributes of GUI controls. The most important attributes are the object used in the Drag & Drop process as well as the type of the Drag & Drop operation.
The type of the Drag & Drop object is described using the FLAVOR. The flavor is a string which can interpretedin a similar way as a class name or a MIME type. Drag & Drop is only possible between GUI controls whose Drag & Drop description has the same FLAVOR.
Other Drag & Drop options allow you to specify whether a control is the source or the target of a Drag & Drop operation, and whether the object is moved or copied in the process.
If you use Drag & Drop, you must program the following steps.
- Create the controls involved and register the corresponding Drag & Drop events.
- Create the necessary Drag & Drop descriptions (CL_DRAGDROP). These descriptions indicate which flavor(s)s an object offers, if the object is the drag source or the drop target, and the type of operation.
- Assign the Drag & Drop descriptions to the controls or their Drag & Drop-enabled objects. Dependingon the control wrapper and the interface, you assign these descriptions using an object of the class CL_DRAGDROP or using the handle of an instance of the class CL_DRAGDROP (see method GET_HANDLE).
- Provide event handlers. In most cases, Drag & Drop is not implemented by the control wrappers, butmust be implemented by the control users. There are up to four events the occurrence of which can be implemented.
Drag & Drop is performed based on the following scheme:
- Drag & Drop operations can only be started on objects that are designated as drag sources. At the time an object is dragged, no events are generated. All events are delayed until the drop operation takes place.
- Drop operations can only be performed on objects that fulfull the following requirements:
- The flavors of the drag source and the drop target must be identical.
- The effekt (move / copy) must be the same.
- Both objects must exist in the same program (internal mode).
In this case, the user can drop the object.
- The following events may occur for Drag & Drop users. (Depending on the control implementation, these events may have different names and additional control-specific parameters).
- OnGetFlavor : This event is triggered if several possible identical flavors exist. The target object can determine the desired flavor in this event handler.
- OnDrag : This event is triggered on the source object of the Drag & Drop operation. The event handlermust uniquely describe the object subject to the operation. To do this, the event handler uses the classCL_DRAGDROPOBJECT. This class has the attribute OBJECT TYPE REF TO OBJECT in which the event handler can place any object.
- OnDrop : This event is triggered on the target object of the Drag & Drop operation. The event handlermust evaluate the object provided in OnDrop and carry out corresponding actions (insert new data) on the target control.
- OnDropComplete : This event is triggered on the source object if the event OnDrop has been handledsuccessfully. The source object may perform corresponding actions, in particular, in the case of move operations.
All events have a Drag and Drop object as a parameter. In addition to the application object, this object contains information on the flavor and a method for cancelling the Drag & Drop operation.
Addresses (Business Address Services) General Material Data
This documentation is copyright by SAP AG.
Length: 4052 Date: 20120526 Time: 141710 triton ( 179 ms )






