Problem: Selecting Text instead of Dragging

67 views
Skip to first unread message

Meredith O.

unread,
Jul 15, 2015, 11:51:55 PM7/15/15
to gwt...@googlegroups.com
I have an HTML panel that wraps a label where the code is VERY similar to demo 5's sample code. The mouse cursor suggests that the thing it's hovering over is draggable but it ends up selecting text instead when trying to start the drag. Can you suggest any workarounds?

Thanks,
Meredith

Fred Sauer

unread,
Jul 18, 2015, 12:43:21 AM7/18/15
to gwt...@googlegroups.com
Have you tried:

 dragController.setBehaviorCancelDocumentSelections(true);

--
You received this message because you are subscribed to the Google Groups "gwt-dnd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-dnd+u...@googlegroups.com.
To post to this group, send email to gwt...@googlegroups.com.
Visit this group at http://groups.google.com/group/gwt-dnd.
For more options, visit https://groups.google.com/d/optout.



--

V.B.

unread,
Aug 25, 2015, 9:12:25 PM8/25/15
to gwt-dnd, fr...@allen-sauer.com
Hello,
    I am having a similar problem playing with the demo. Unfortunately, your suggested fix did not work for me. In my case I tried creating a custom widget (using UiBinder) to replace the HTML panel used in the demo. Can you post an example of how to make a drag-capable custom widget using UiBinder?

Thanks for a great library.

Erinjen Lin

unread,
Aug 27, 2015, 8:35:41 PM8/27/15
to gwt-dnd, fr...@allen-sauer.com
Hi Fred!
I have additional information for you. It seems that changing HTML to HTML Panel causes the dragging to not work. How do I go about creating more complex draggable items? Like the previous poster, I too would like to use UI Binder.

Fred Sauer

unread,
Aug 27, 2015, 11:26:57 PM8/27/15
to Erinjen Lin, gwt-dnd

gwt-dnd was designed back in the day when all GWT had when it came to UI components was the Widget class and its base classes, so it will only work w in that world.

Nowadays may be better off using HTML5 based dragging.

V.B.

unread,
Aug 28, 2015, 12:54:22 PM8/28/15
to gwt-dnd, ej...@umich.edu, fr...@allen-sauer.com
Thank you for your response.
Can you suggest the best approach for going about that (HTML5-based dragging) via GWT?

Fred Sauer

unread,
Aug 28, 2015, 12:55:54 PM8/28/15
to V.B., gwt-dnd, ej...@umich.edu

Tara S.

unread,
Aug 29, 2015, 3:13:05 PM8/29/15
to gwt-dnd
Hi Fred,

HTMLPanel and other Panels inherit from the Widget class, so shouldn't they be draggable and droppable as well? Or am I misunderstanding the way in which DnD and Widgets work?

Thanks,
Tara

Fred Sauer

unread,
Aug 29, 2015, 3:30:34 PM8/29/15
to gwt...@googlegroups.com

Widgets should be draggable if their ancestors is the drag container FocusPanel, although gwt-dnd was created before UIBinder, so there may be issues I'm not aware of.

--

Erinjen Lin

unread,
Aug 29, 2015, 5:02:40 PM8/29/15
to gwt-dnd
I just tried using Focus Panel and it worked, but I'm a little confused on why this would work with Focus Panel instead of Simple Panel or Vertical Panel?

Fred Sauer

unread,
Aug 29, 2015, 6:02:58 PM8/29/15
to gwt...@googlegroups.com
Erinjen,

I recommend looking through the 14 demos, find the one which matches closest to what you're trying to achieve, and then looking through the source code (see links at the top of each demo).

Fred

--
Reply all
Reply to author
Forward
0 new messages