Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:00:45+00:00 2026-06-12T23:00:45+00:00

When you go to this page for example : http://grooveshark.com/#!/search?q=stackoverflow and then start dragging

  • 0

When you go to this page for example : http://grooveshark.com/#!/search?q=stackoverflow and then start dragging any song you get this nice Drag and Drop behavior :

Drag started

Then, during the Drag and Drop, when you are hovering a zone that accepts the drop, the image under the cursor changes to display that a drop is possible :

Drag Over

Is there any chance to get this kind of thing working with GWT ?

I’ve made a dummy widget for some text, and changing the DragImage after the drag have started, do not seems to work. I’ve also tried changing the cursor, but without success

@Override
        public void onDragOver(DragOverEvent event) {
            dragIndicator.setInnerText("CAN DROP !");
            event.getDataTransfer().setDragImage(dragIndicator,
                    10, 10);
        }  

It’s nice to have the Drag and Drop capabilities, but as I’ve seen here http://allen-sauer.com/com.allen_sauer.gwt.dnd.demo.DragDropDemo/DragDropDemo.html#BinExample we can only modify the hovered element. Am I wrong ?

EDIT

Upon reading the W3C (http://dev.w3.org/html5/spec/dnd.html#the-drag-data-store) I’ve encountered this :

The dropEffect attribute controls the drag-and-drop feedback that the
user is given during a drag-and-drop operation. When the DataTransfer
object is created, the dropEffect attribute is set to a string value.
On getting, it must return its current value. On setting, if the new
value is one of “none”, “copy”, “link”, or “move”, then the
attribute’s current value must be set to the new value. Other values
must be ignored.

However, I didn’t find anything like that in the GWT code, maybe I will try it using JSNI (have to check if it’s a standard or not)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:00:47+00:00Added an answer on June 12, 2026 at 11:00 pm

    Okay, I’ve managed to change the cursor during the hovering (tested only in FF 15) using JSNI. This is far from being complete and correct.

    public class MonWidget extends Widget implements HasAllDragAndDropHandlers {
    
    private DivElement mainDiv;
    
    public MonWidget()
    {
        mainDiv = Document.get().createDivElement();
    
        SpanElement span1 = Document.get().createSpanElement();
        span1.setInnerText("span1");
        span1.setDraggable(Element.DRAGGABLE_TRUE);
        span1.getStyle().setBackgroundColor("red");
    
        SpanElement span2 = Document.get().createSpanElement();
        span2.setInnerText("span2");
        span2.setDraggable(Element.DRAGGABLE_TRUE);
        span2.getStyle().setBackgroundColor("blue");    
    
        mainDiv.appendChild(span1);
        mainDiv.appendChild(span2);
    
        setElement(mainDiv);
    
        this.addDragStartHandler(new DragStartHandler() {
            public void onDragStart(DragStartEvent event) {
    
                Element element = Element.as(event.getNativeEvent().getEventTarget());
                event.setData("text", "some data");
                event.getDataTransfer().setDragImage(element,
                        10, 10);        
            }
        });
    
        this.addDragOverHandler(new DragOverHandler() {
    
            @Override
            public void onDragOver(DragOverEvent event) {
                setEffet(event.getNativeEvent(),"copy");
                //setEffet(event.getNativeEvent(),"link");
                // THIS do not seems to work - setEffet(event.getNativeEvent(),"move");
                event.stopPropagation();
            }
        });
    }
    ....
    

    And the JSNI method :

    public final native void setEffet(NativeEvent e, String effect) /*-{
         var dt = e.dataTransfer;
         dt.dropEffect = effect;
      }-*/;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example form, https://stackoverflow.com/questions/ask and I save this page to desktop. Then I edit the
If I have this page in http://example.com/login with GET verb: <form action=https://example.com/login method=post> <input
Let's say I'm on a page on my website: http://www.example.com/SearchResults.asp?Search=stackoverflow . Is it possible
I'm scraping this page: http://kat.ph/search/example/?field=seeders&sorder=desc In this way: ... curl_setopt( $curl, CURLOPT_URL, $url );
I have a JSP page at an address like this: http://example.com/foo/bar/rawr/something.jsp When I output
I want to subscribe to a facebook page for example with this url ,http://www.myurl.com
I have a page, URI looks like this: http://domain.example.com/Profiles/Profile.aspx?username=blah#blahtab When that fragment (#blahtab) is
Taking the XSLT and XML from this page as an example: http://www.w3schools.com/xsl/xsl_transformation.asp I have
See the gray bar in this example page: http://dss.com.bo/inicio.aspx Here is my attempt at
I followed the example: http://arunranga.com/examples/access-control/credentialedRequest.html from this page: http://arunranga.com/examples/access-control/ The example work in Firefox,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.