4Dv11.8 drag and drop with list boxes header gotcha
4Dv11.8 drag and drop with list boxes header gotcha
Using new functionality drag and drop with 4D list boxes?
Watch out for this: only the entire listbox object can be made draggable/droppable from the actions pane of the object properties.
Even though a listbox is made of headers and column rows, a drag from cells to the header will show as invalid at the UI level. If the user tries to drop it on a header 4D will still go into the list box object method On drop
form event.
Moving the on drop code to the columns object method inside the list box has no effect. Dropping a cell onto a header still throws the On drop
event.
OK
is of no help either, it is 1 regardless of drop target. If Drop position
returns -1 seems to be the only indicator a header row was dropped on. A 0 indicates dropping the cell beyond the populated values.
Either way it is frustrating to program around. How about a Get current target
method, or change drag and drop properties function call. To state that the current object method executing is the drop target is clearly not granular enough to differentiate from data rows and header rows.
I should also note that returning -1 from On Drag Over
event prevents any code from executing On Drop
and displays the invalid drop target icon.
` old way
DRAG AND DROP PROPERTIES ( srcObject ; srcElement ; srcProcess )
` new way
DRAG AND DROP PROPERTIES ( srcObject ; srcElement ; srcProcess ; tarObject ; tarElement ; tarProcess )
Author’s Note
Initial md
Generated using https://github.com/jsr6720/wordpress-html-scraper-to-md
Original Wordpress categories: [‘4D’]
Original Wordpress tags: “4D”, “4D”, “drag-and-drop”, “listbox”
Original Wordpress comments: None
Significant Revisions
tags: 2010, wordpress, txcowboycoder, 4D, drag-and-drop, listbox, ui, gotchas
- May 6th, 2024 Converted to jekyll markdown format and copied to personal site
- Nov 17th, 2010 Originally published on txcowboycoder wordpress site