Announcement

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

    cannot use Drag Create example

    While trying to implement Drag Create sample as shown in the ShowCase, I am unable to add DragPiece object to a HorizontalPanel.

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(new DragPiece("cube_blue.png", "b"));

    There is a runtime exception. I could see the below error message in the Browser console.
    Uncaught Type error: Cannot read property "Create" of Undefined at the line - var widget = $wnd.isc[scClassName].create(config);

    Img.java

    protected native JavaScriptObject create()/*-{
    var config = this.@com.smartgwt.client.widgets.BaseWidget::getConfig()();
    var scClassName = this.@com.smartgwt.client.widgets.BaseWidget::scClassName;
    var widget = $wnd.isc[scClassName].create(config);
    if ($wnd.isc.keepGlobals) this.@com.smartgwt.client.widgets.BaseWidget::internalSetID(Lcom/google/gwt/core/client/JavaScriptObject;)(widget);
    this.@com.smartgwt.client.widgets.BaseWidget::doInit()();
    return widget;
    }-*/;


    I am using superDevMode on Chrome Version 64.0.3282.186 (Official Build) (64-bit) on Windows7 - 64bit

    #2
    It looks like you are trying to mix GWT and SmartGWT components. This won't work well in general (see FAQ) and definitely will not work for drag and drop without a lot of additional code to map between the SmartGWT and GWT drag and drop systems (which are totally separate). Use the same widgets you see in the sample instead.

    Comment

    Working...
    X