cancel
Showing results for 
Search instead for 
Did you mean: 

Drag-and-drop

former_member445524
Participant
0 Kudos
Hello, all

I tried to implement drag-and-drop functionality between two
B1 matrices and met with two problems.  Firstly, the et_Drag
event seems to work only if the Cockpit is on.  The Cockpit
being absolutely unrealted to ordinrary B1 forms, this
limitation seems utter nonsense.

Secondly, the target of the et_Drag event is epxressed in
terms not of an item id, possibly with a column id and row
number for matrices and grids, but of coordinates with
respect to the target form.  Is not there any method in
UI API to determine to which item (and to which column and
row on a matrix or grid,) the coordinates point?

How do you overcome these obstacles in your programs, or do
you implement drag-and-drop manually without reliacne on
B1's seemingly deficient support for it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anton,

The Drag & Drop functionalities in the SDK are effectively related to the cockpit... And are specific to widgets: absolutely not useful for anything else.

Except if SAP modifies the SDK sooner or later regarding this, you have either to:

  • "Dive" into the Windows SDK (get handler of the dragged object, get handler of the drop to object, convert into B1's SDK object and apply)m
  • Keep data (clicked object, column row on the click before event) get data on the drop to object (I would surely not go alone to the click after event, but to combine with the GotFocus one).

Regards,

Eric

former_member445524
Participant
0 Kudos
Eric Lapouge:

> The Drag & Drop functionalities in the SDK are effectively
> related to the cockpit... And are specific to widgets:
> absolutely not useful for anything else.

Not at all.  Drag-and-drop works on many system forms, and
with the Cockpit activated, add-ons can intercept it on
ordinary (system or user) forms and items as well.  I have
checked it with two EditText's or a custom form.

> Except if SAP modifies the SDK sooner or later regarding
> this, you have either to:
>
>   -- "Dive" into the Windows SDK (get handler of the
>      dragged object, get handler of the drop to object,
>      convert into B1's SDK object and apply
>
>   -- Keep data (clicked object, column row on the click
>      before event) get data on the drop to object (I would
>      surely not go alone to the click after event, but to
>      combine with the GotFocus one).

The second option I have had to follow.  I modify the cells'
context menu via the Right_Click event, adding thereto a
custom "Select" item.  Once selected, the cell font is
changed to bold and a "Copy hither" and "Move hither"
commands become available in the cells' context menu
allowing the user to copy or move the element from a
previsosly selected cell to the current one.

It is even better than drag-and-drop for cells far apart in
the matrix.

Answers (0)