Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HTML5 file drag and drop on SmartGWT component

    Hello,

    I'm trying to achieve something similar to http://www.vectomatic.org/libs/lib-gwt-file, ie using HTML5 File API to upload a file with drag and drop from the desktop. Custom events handlers are attached to GWT components using addBitlessDomHandler to handle the drag and drop events.
    I want to avoid mixing GWT components and SmartGWT components but I can't get the addBitlessDomHandler method to work for drag and drop events on SmartGWT components. It works on a GWT SimplePanel.

    Here is simplified example:
    Code:
    public class TestPortal implements EntryPoint {
    
        public void onModuleLoad() {
            VLayout rootLayout = new VLayout();
            ToolStrip toolStrip = new ToolStrip();
            ToolStripButton button = new ToolStripButton("Hello very long text to fill space");
            button.addBitlessDomHandler(new DragEnterHandler() {
                @Override
                public void onDragEnter(DragEnterEvent event) {
                    System.out.println("drag enter " + event);
                }
            }, DragEnterEvent.getType());
            toolStrip.addButton(button);
            rootLayout.draw();
    }
    }
    I don't want to use a FileUpload item because the current UI has a button that open a dialog with the upload form and I want to drop the file on that button.
    I'm using 3.1p tested with Chromium 25 and FF 19.0.2.

    Thanks for you help,

    Youri
    Last edited by Youri; 5 Apr 2013, 06:17.

    #2
    Nobody tried to do something like that?
    It seems pretty common now :/

    Comment


      #3
      Hi Youri,

      Did you find a way to get this to work in SmartGWT in the end?

      Comment

      Working...
      X