You can add drag and drop functionality to your components. Drag
and drop is a user interface action that involves dragging components
or objects using a pointing device and dropping them over other objects
on the frame, which results in some action. For example, a text entry
control that contains the name of a SAS table could be dragged onto
a data table component and then dropped to display the contents of
the SAS table in the data table. Drag and drop also works between
objects on different frames.
Components that can
be dragged are called drag sites, and components that can receive
a dropped object are called drop sites. When an object is dropped,
data is passed to the drop site and an action occurs. The action is
determined by:
-
the form in which the data is passed,
called the data representation
-
the type of drop operation
The data representation
is the form of data that a drag site is capable of transferring and
a drop site is capable receiving. The data can be as simple as a string
of text or as complex as an SCL list.
SAS/AF components that are based on the SAS Component Object
Model (SCOM) use
a generic representation
to indicate when a character string is passed as the data
a generic representation
to indicate when numeric values are passed as the data
Legacy objects support
three default data representations, all of which provide data in a
character string:
-
-
_DND_FILE for an external file
-
_DND_DATASET for a SAS table
Additional data representations enable you to drag
items from the SAS Explorer and to drop them onto a frame. These representations
include
-
EXPLORER_DATASET_NAME for SAS tables.
The data is provided in a character string that contains the two-level
SAS table name, such as
sasuser.fitness
.
-
EXPLORER_CATALOG_NAME for SAS catalogs.
The data is provided in a character string that contains the two-level
SAS catalog name, such as
sashelp.classes
.
-
EXPLORER_ENTRY_NAME for a specific
catalog entry. When the selection includes a single entry, the data
is provided in a character string that contains the four-level entry
name, such as
work.a.a.scl
. When the
selection includes two or more entries, the data is provided in a
list in which each item is a character string that contains the four-level
entry name.
-
EXPLORER_MEMBER_NAME for multiple
selections from a SAS library. When the selection includes a single
entry, the data is provided in a character string that contains a
two-level member name for catalogs or a three-level member name for
SAS tables (including those of type VIEW). When the selection includes
two or more members, the data is provided in a list in which each
item is a character string. Note that multiple selections of SAS tables
or SAS catalogs are sent in an EXPLORER_MEMBER_NAME data representation.
If you create a component
based on SCOM architecture, you can define your own data representations
if characterData and numericData do not meet your needs.
A data representation
is essentially a “verbal contract” between two components.
As a component developer, you must name the data representation. For
example, the characterData representation states that whatever component
uses this as its drag representation, the drag site will send a valid
character value as the data. The drop site then expects to receive
a character value and can react accordingly.
It is recommended that
component developers fully document their data representations so
that other developers can know how to use them. See
How the Drag and Drop Component Works for more information about the data representation.
Drop operations define
actions that are performed on the data representation:
Data is provided with
no post-processing.
Some mechanism synchronizes
the source and destination.
Data is provided and
the source is removed.
Copy is the default.
Drag and drop operations
in
SAS/AF software have
the following limitations:
-
You cannot drag objects outside
the SAS environment.
-
Slider and scroll bar components
do not support drag and drop operations.
-
The behavior of drag and drop operations
may vary according to the host environment.