1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2011
    Posts
    23
    Vote Rating
    0
    ProgettoFideuram is on a distinguished road

      0  

    Default Unanswered: TreeGrid: TreeStore clear and reload doesn't work

    Unanswered: TreeGrid: TreeStore clear and reload doesn't work


    Hi all, i will try to use a TreeGrid (gxt 3.0.0b), following a snippet of code:

    Code:
    public class MyTreeGrid extends VerticalLayoutContainer  {
    ...
    TreeGrid treeWidget = new TreeGrid<T>(treeStore, columnModel, treeColumn);
    add(treeWidget);
    ...
    
    public void update(List<Employee> items) {
        treeStore.clear();
        for (T item : items) {            
               treeStore.add(item);
               genChildrens(item, item, childrensProperties, 0);
         }
    }
    }
    The first time (treeStore is empty), everything works fine, from the second try, i received the following errors:
    Code:
    Fri Jul 27 13:16:35 CEST 2012 it.bancafideuram.sei.consulenzaevoluta.client.app.ConsulenzaEvolutaEP
    SEVERE: One or more exceptions caught, see full set in UmbrellaException#getCauses
    com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
        at com.sencha.gxt.data.shared.Store.fireEvent(Store.java:609)
        at com.sencha.gxt.data.shared.TreeStore.insert(TreeStore.java:963)
        at com.sencha.gxt.data.shared.TreeStore.add(TreeStore.java:359)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.genChildrens(DPFAbstractTreeGrid.java:384)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.genChildrens(DPFAbstractTreeGrid.java:382)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.update(DPFAbstractTreeGrid.java:342)
        at it.bancafideuram.dpf.client.ui.widget.grid.DPFAbstractGrid.update(DPFAbstractGrid.java:528)
        at it.bancafideuram.dpf.client.ui.widget.grid.DPFAbstractGrid.update(DPFAbstractGrid.java:528)
        at it.bancafideuram.sei.client.diagnosis.dipa02a.activity.DIPA02APatrimonyHousePortfolioActivity$AsyncCallBack.onSuccess(DIPA02APatrimonyHousePortfolioActivity.java:630)
        at it.bancafideuram.sei.client.diagnosis.dipa02a.activity.DIPA02APatrimonyHousePortfolioActivity$AsyncCallBack.onSuccess(DIPA02APatrimonyHousePortfolioActivity.java:1)
        at it.bancafideuram.dpf.client.service.DPFAsyncCallbackAdapter.onSuccess(DPFAsyncCallbackAdapter.java:99)
        at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
        at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
        at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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:337)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        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:213)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): Object doesn't support property or method 'insertBefore'
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        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:201)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGridView.onJointChange(TreeGridView.java:170)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.refresh(TreeGrid.java:610)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid.onAdd(TreeGrid.java:902)
        at com.sencha.gxt.widget.core.client.treegrid.TreeGrid$1.onAdd(TreeGrid.java:246)
        at com.sencha.gxt.data.shared.event.StoreAddEvent.dispatch(StoreAddEvent.java:125)
        at com.sencha.gxt.data.shared.event.StoreAddEvent.dispatch(StoreAddEvent.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:609)
        at com.sencha.gxt.data.shared.TreeStore.insert(TreeStore.java:963)
        at com.sencha.gxt.data.shared.TreeStore.add(TreeStore.java:359)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.genChildrens(DPFAbstractTreeGrid.java:384)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.genChildrens(DPFAbstractTreeGrid.java:382)
        at it.bancafideuram.dpf.client.ui.widget.table.DPFAbstractTreeGrid.update(DPFAbstractTreeGrid.java:342)
        at it.bancafideuram.dpf.client.ui.widget.grid.DPFAbstractGrid.update(DPFAbstractGrid.java:528)
        at it.bancafideuram.dpf.client.ui.widget.grid.DPFAbstractGrid.update(DPFAbstractGrid.java:528)
        at it.bancafideuram.sei.client.diagnosis.dipa02a.activity.DIPA02APatrimonyHousePortfolioActivity$AsyncCallBack.onSuccess(DIPA02APatrimonyHousePortfolioActivity.java:630)
        at it.bancafideuram.sei.client.diagnosis.dipa02a.activity.DIPA02APatrimonyHousePortfolioActivity$AsyncCallBack.onSuccess(DIPA02APatrimonyHousePortfolioActivity.java:1)
        at it.bancafideuram.dpf.client.service.DPFAsyncCallbackAdapter.onSuccess(DPFAsyncCallbackAdapter.java:99)
        at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
        at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
        at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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:337)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        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:213)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Unknown Source)
    I analyzed debugging code and I found a strange behaviour: the root element is created without problem, following the first column
    Code:
    <div id="x-widget-56_4161744" class="GNSJ1SDCOB"><div class="GNSJ1SDPNB"><img src='http://localhost:8080/ConsulenzaEvoluta/consulenzaEvoluta/clear.gif' style='height: 18px; width: 0px;' /><img src="http://localhost:8080/ConsulenzaEvoluta/consulenzaEvoluta/clear.gif" style="width: 16px" class="GNSJ1SDBOB" /><span class='GNSJ1SDLNB'></span><span class="GNSJ1SDAOB"></span><span class="GNSJ1SDFOB"><div style='font-weight: bold; white-space:normal;'>Extra Rendimento</div></span></div></div>
    but when a child is added, the method getElemet() of TreeNode class (com.sencha.gxt.widget.core.client.tree.TreeNode) doesn't retrieve the element generated:
    Code:
    public Element getElement() {
          if (element == null) {
            element = (Element) Document.get().getElementById(id);
          }
          return element;
    }
    where id="x-widget-56_4161744" and element=null
    Thanks in advanced

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
    Answers
    2
    esag_dk is on a distinguished road

      0  

    Default


    I've got the same exception using another code. You can find a workaround here:
    http://www.sencha.com/forum/showthre...ption&p=872462

    Hopefully this will get fixed in a future release.

Thread Participants: 1

Tags for this Thread