Results 1 to 2 of 2

Thread: GXT3.1.0 TreeGrid Node was not found error

  1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    1
    Vote Rating
    1
      1  

    Default GXT3.1.0 TreeGrid Node was not found error

    Hi everyone,

    I'm trying to implement a TreeGrid with the ability to add nodes dynamically after user input. The grid is populated initially with data and the user can add nodes.

    This is what the initial grid looks like:
    initialgrid.png
    On the initial load, I'm getting the following error:
    Code:
    15:05:11.876 [ERROR] [ddd] Fri Jan 09 15:05:11 EST 2015 com.sourcefire.ddd.client.util.UncaughtExceptionMessenger
    SEVERE: (NotFoundError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(391), JavaScript object(390), JavaScript object(454)]): Node was not found
    
    com.google.gwt.core.client.JavaScriptException: (NotFoundError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(391), JavaScript object(390), JavaScript object(454)]): Node was not found
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:356)
        at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:744)
    You'll notice that the US expanded icon isn't the correct icon. Expanding and collapsing that node will generate this error again. In addition, deleting the Ohio node causes this error:

    Code:
    15:14:31.679 [ERROR] [ddd] Fri Jan 09 15:14:31 EST 2015 com.sourcefire.ddd.client.util.UncaughtExceptionMessenger
    SEVERE: (NotFoundError) @com.google.gwt.dom.client.Node::insertBefore(Lcom/google/gwt/dom/client/Node;Lcom/google/gwt/dom/client/Node;)([JavaScript object(2760), JavaScript object(711)]): Node was not found
    
    com.google.gwt.core.client.JavaScriptException: (NotFoundError) @com.google.gwt.dom.client.Node::insertBefore(Lcom/google/gwt/dom/client/Node;Lcom/google/gwt/dom/client/Node;)([JavaScript object(2760), JavaScript object(711)]): Node was not found
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.dom.client.Node$.insertBefore$(Node.java)
        at com.sencha.gxt.theme.base.client.tree.TreeBaseAppearance.onJointChange(TreeBaseAppearance.java:215)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGridView.onJointChange(TreeGridView.java:258)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.refresh(TreeGrid.java:604)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGridView.collapse(TreeGridView.java:80)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.setExpanded(TreeGrid.java:713)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.setExpanded(TreeGrid.java:644)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.onRemove(TreeGrid.java:1044)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid$1.onRemove(TreeGrid.java:259)
        at com.sencha.gxt.data.shared.event.StoreRemoveEvent.dispatch(StoreRemoveEvent.java:112)
        at com.sencha.gxt.data.shared.event.StoreRemoveEvent.dispatch(StoreRemoveEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        at com.sencha.gxt.data.shared.Store.fireEvent(Store.java:610)
        at com.sencha.gxt.data.shared.TreeStore.remove(TreeStore.java:731)
     com.google.gwt.cell.client.CompositeCell.onBrowserEventImpl(CompositeCell.java:242)
        at com.google.gwt.cell.client.CompositeCell.onBrowserEvent(CompositeCell.java:138)
        at com.sencha.gxt.widget.core.client.grid.Grid.fireEventToCell(Grid.java:875)
        at com.sencha.gxt.widget.core.client.grid.Grid.handleEventForCell(Grid.java:907)
        at com.sencha.gxt.widget.core.client.grid.Grid.onBrowserEvent(Grid.java:594)
        at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1714)
        at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1653)
        at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:325)
        at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:356)
        at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:744)
    I've explored many similar posts with this error, but many of them say the bug has been fixed in GXT or their workarounds simply don't work or don't apply to me. I can't provide a working example since this portion is part of a much larger project, but I'll try to show any relevant code here.

    In the view, this is how the initial grid is constructed:

    Code:
    public void setNodes(MyNode currentNode) {
        treeStore.clear();
        treeStore.add(currentNode);
        _setNodes(currentNode);
        treeGrid.expandAll();
    }
    
    private void _setNodes(MyNode currentNode) {
        if (!currentNode.getChildren().isEmpty()) {
            for (MyNode child : currentNode.getChildren()) {
                treeStore.add(currentNode, child);
                _setDomains(child);
            }
        }
    }
    Code:
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    
    import com.sencha.gxt.data.shared.TreeStore;
    
    public class MyNode implements Serializable, TreeStore.TreeNode<MyNode> {
    
        private String id;
        private String name;
        private String parent;
        private List<MyNode> children;
    
        protected MyNode() {
    
        }
    
        public MyNode(String id, String name, String parent) {
            this.id = id;
            this.name = name;
            this.parent = parent;
            children = new ArrayList<MyNode>();
        }
    
        ... getters and setters
    
        @Override
        public MyNode getData() {
            return this;
        }
    
        @Override
        public List<MyNode> getChildren() {
            return children;
        }
        
        public void setChildren(List<MyNode> children) {
            this.children = children;
        }
    
        public void addChild(MyNode child) {
            getChildren().add(child);
        }
        
        public void removeChild(MyNode child) {
            if (getChildren().contains(child)) {
                getChildren().remove(child);
            }
        }
        @Override
        public String toString() {
            return name != null ? name : super.toString();
        }
    
    }
    The TreeGrid is attached to a VerticalLayoutContainer using UiBinder.

    Any help would be greatly appreciated, thank you!

  2. #2
    Sencha Premium User
    Join Date
    Sep 2015
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Did you solve it in the meantime? I've a quite similar problem.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •