Announcement

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

    Drag from Grid/Tree to Grid/Tree using datasources

    Hi, I am tring to drag from a grid or tree to a tree. I works when is from non datasource tree to non datasource tree as in showcase examples, but it fails when from datasource tree or grid.

    This is the message when the origin is a datasource based grid:

    Uncaught exception escaped : java.lang.ClassCastException
    com.smartgwt.client.widgets.grid.ListGridRecord cannot be cast to com.smartgwt.client.widgets.tree.TreeNode
    See the Development console log for details.
    Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.

    This is the message when from datasource based tree:

    Uncaught exception escaped : java.lang.ClassCastException
    com.smartgwt.client.widgets.grid.ListGridRecord cannot be cast to com.smartgwt.client.widgets.tree.TreeNode
    See the Development console log for details.
    Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.

    How can I use mouse drag with datasouce based views? I have considered even building the requested treenode myself but I do not know where as this excepction is internal and I do not know in witch moment or where should I do it.

    Thanks,
    txemi

    #2
    We'll look into this. Please file an issue with a standalone testcase or a modification to a showcase sample.
    Last edited by smartgwt.dev; 4 Aug 2010, 07:54.

    Comment


      #3
      Which version of Smart GWT are you using? Always mention this.

      Comment


        #4
        I am having the same issue when dragging a grid record that uses a datasource to a tree without a datasource. A tree node is being added to the tree with the name retrieved from the grid record correctly, but the icon is different so I am trying to change it in the handler. That's when the exception is thrown:

        Code:
        this.addFolderDropHandler(new FolderDropHandler() {
        	@Override
        	public void onFolderDrop(FolderDropEvent event) {
        
        		if(event.getSourceWidget() instanceof MyGrid) {
                               //this throws the exception mentioned in the first post
        			System.out.println(event.getNodes()[0].getAttribute("name"));
        
        		}
        	}
        });
        I am using version 2.3 from the latest build (11 Sep). I will post a standalone test case later if required.

        Comment

        Working...
        X