Announcement

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

    TreeGrid ResultSet Fetch question

    SmartClient Version: v9.1p_2014-09-09/PowerEdition Deployment (built 2014-09-09)
    GWT 2.6.1
    IE-11

    I have a TreeGrid configured for Load On Demand. When I expand a node on the tree, I see the DSFetch go through my RequestTransformer with parentID set to the node I expanded.

    I have a case where I need to invalidate the cache in the TreeGrid for that already-in-process load on demand fetch for that node I just expanded. Is this possible?

    Because I will be returning the entire tree already loaded in the TreeGrid along with that node that was just expanded. Basically this use case is on any node expansion we need to return the entire tree set of data plus the node expanded. Which is slightly different than the standard load on demand, because that assumes only adding records based on the node expanded.

    Here we want to replace all tree data plus the node expanded.

    Or could I set on the DSResponse (on the server) DSResponse.setInvalidateCache(true) with the entire tree + node expansion in the data of the DSResponse going back to the client? Assuming the client would drop the cache first, and rebuild the cache with the data set just sent?
    Last edited by JLivermore; 22 Sep 2014, 13:17.

    #2
    It looks like you figured this out after thinking a while - yes, setting invalidateCache and returning whatever new cached nodes you want should give the result you're looking for.

    Comment


      #3
      I end up with a blank grid, even though my DSResponse contains the entire tree in the data and the invalidate cache is set to true, I get a blank grid which tells me something is not right?

      DSResponse with data cut out:
      Code:
      [
          {
              affectedRows:0, 
              data:[
                  --- snipped ---
              ], 
              endRow:38, 
              invalidateCache:true, 
              isDSResponse:true, 
              queueStatus:0, 
              startRow:0, 
              status:0, 
              totalRows:38
          }
      ]
      Last edited by JLivermore; 22 Sep 2014, 15:04.

      Comment


        #4
        Here is what we're seeing in the RPC tabs in the dev console (sensitive data has been replaced with XXXXXX):
        DSRequest
        Code:
        {
            dataSource:"pivot_table_tree_fact_RTF_384_682", 
            operationType:"fetch", 
            componentId:"isc_PivotTableGrid_5_0", 
            data:{
                pid:"XXXXXX", 
                spcs:[
                    "189", 
                    "2014-09-23", 
                    "2014-09-23", 
                    "RTF", 
                    "190:2^682|189:2", 
                    "", 
                    "873|872|875|874|867|870", 
                    "141", 
                    "", 
                    "true", 
                    "384", 
                    "2355", 
                    "682", 
                    "realTimeEquitiesFactDataSource", 
                    "189", 
                    "2014-09-23", 
                    "2014-09-23", 
                    "RTF", 
                    "190:2^682|189:2", 
                    "141:2^XXXXXX", 
                    "873|872|875|874|867|870", 
                    "139", 
                    "XXXXXX", 
                    "false", 
                    "384", 
                    "2355", 
                    "682", 
                    "realTimeEquitiesFactDataSource"
                ], 
                inVC:true
            }, 
            textMatchStyle:"exact", 
            resultTree:[ResultTree ID:isc_ResultTree_0 (created by: isc_PivotTableGrid_5_0)], 
            callback:{
                caller:[ResultTree ID:isc_ResultTree_0 (created by: isc_PivotTableGrid_5_0)], 
                methodName:"loadChildrenReply"
            }, 
            willHandleError:true, 
            showPrompt:false, 
            prompt:"Loading...", 
            oldValues:{
                pid:"XXXXXX", 
                spcs:[
                    "189", 
                    "2014-09-23", 
                    "2014-09-23", 
                    "RTF", 
                    "190:2^682|189:2", 
                    "", 
                    "873|872|875|874|867|870", 
                    "141", 
                    "", 
                    "true", 
                    "384", 
                    "2355", 
                    "682", 
                    "realTimeEquitiesFactDataSource", 
                    "189", 
                    "2014-09-23", 
                    "2014-09-23", 
                    "RTF", 
                    "190:2^682|189:2", 
                    "141:2^XXXXXX", 
                    "873|872|875|874|867|870", 
                    "139", 
                    "XXXXXX", 
                    "false", 
                    "384", 
                    "2355", 
                    "682", 
                    "realTimeEquitiesFactDataSource"
                ], 
                inVC:true
            }, 
            requestId:"pivot_table_tree_fact_RTF_384_682$6274", 
            internalClientContext:{
                parentNode:{
                    SharesOrdered:102810, 
                    dOppCostBP:28.235433388090282, 
                    SharesRemaining:19644, 
                    dIVWAPCPS:-1.856864847048787, 
                    name:"XXXXXX", 
                    pid:"Grand Total", 
                    cid:"XXXXXX", 
                    dOppCostK:3.7966172103881836, 
                    dEntStrikeCPS:-2.772804635412131, 
                    isFolder:true, 
                    children:Array[1]
                }, 
                relationship:{
                    childDS:[DataSource ID:pivot_table_tree_fact_RTF_384_682], 
                    parentDS:[DataSource ID:pivot_table_tree_fact_RTF_384_682], 
                    parentIdField:"pid", 
                    idField:"cid"
                }, 
                childrenReplyCallback:{
                }, 
                fetchCount:2
            }, 
            useStrictJSON:true, 
            fallbackToEval:true, 
            progressiveLoading:false, 
            lastClientEventThreadCode:"pointerup1", 
            bypassCache:true
        }
        DSResponse
        Code:
        [
            {
                affectedRows:0, 
                data:[
                    {
                        SharesOrdered:300, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:-0.7503509521484375, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:0, 
                        dEntStrikeCPS:-1.0149002075195312
                    }, 
                    {
                        SharesOrdered:40000, 
                        dOppCostBP:-37.534023943280964, 
                        SharesRemaining:40000, 
                        dIVWAPCPS:0, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:-2.50877392578125, 
                        dEntStrikeCPS:0
                    }, 
                    {
                        SharesOrdered:8000, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:4.002285003662109, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:0, 
                        dEntStrikeCPS:4.21705239868164
                    }, 
                    {
                        SharesOrdered:409688, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:-4.430754915570285, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:0, 
                        dEntStrikeCPS:-7.525192931951174
                    }, 
                    {
                        SharesOrdered:102810, 
                        dOppCostBP:28.193625377773973, 
                        SharesRemaining:19101, 
                        dIVWAPCPS:-1.8290373609385832, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:3.7382345275878905, 
                        dEntStrikeCPS:-2.761402531060025
                    }, 
                    {
                        SharesOrdered:40000, 
                        dOppCostBP:237.62354038536827, 
                        SharesRemaining:39200, 
                        dIVWAPCPS:-17.944478912353517, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:18.815982421875, 
                        dEntStrikeCPS:17.124986572265626
                    }, 
                    {
                        SharesOrdered:929711, 
                        dOppCostBP:13.753923777484441, 
                        SharesRemaining:184230, 
                        dIVWAPCPS:-4.14252293897015, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:4.475190856933594, 
                        dEntStrikeCPS:-4.608328681646788
                    }, 
                    {
                        SharesOrdered:70000, 
                        dOppCostBP:132.7572546789974, 
                        SharesRemaining:57500, 
                        dIVWAPCPS:-1.9098191015625, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:12.076263671875, 
                        dEntStrikeCPS:12.146196640625
                    }, 
                    {
                        SharesOrdered:14906, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:-1.5587397577553712, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:0, 
                        dEntStrikeCPS:-2.6927180922976696
                    }, 
                    {
                        SharesOrdered:55000, 
                        dOppCostBP:-113.5798238863254, 
                        SharesRemaining:55000, 
                        dIVWAPCPS:0, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:-23.163470703125, 
                        dEntStrikeCPS:0
                    }, 
                    {
                        SharesOrdered:1130, 
                        dOppCostBP:0, 
                        SharesRemaining:1130, 
                        dIVWAPCPS:0, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:22.509599609375, 
                        dEntStrikeCPS:0
                    }, 
                    {
                        SharesOrdered:36400, 
                        dOppCostBP:27.605219538039925, 
                        SharesRemaining:36400, 
                        dIVWAPCPS:0, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:1.4559986572265624, 
                        dEntStrikeCPS:0
                    }, 
                    {
                        SharesOrdered:0, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:0, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dEntStrikeCPS:0
                    }, 
                    {
                        SharesOrdered:3150, 
                        dOppCostBP:8.801092279517703, 
                        SharesRemaining:2550, 
                        dIVWAPCPS:-0.3513336181640625, 
                        name:"XXXXXX", 
                        pid:"Grand Total", 
                        cid:"XXXXXX", 
                        dOppCostK:0.08317031860351562, 
                        dEntStrikeCPS:-0.3513336181640625
                    }, 
                    {
                        SharesOrdered:1711095, 
                        dOppCostBP:38.99968644559795, 
                        SharesRemaining:435111, 
                        dIVWAPCPS:-3.986246436882543, 
                        name:"Grand Total", 
                        cid:"Grand Total", 
                        dOppCostK:37.482195434570315, 
                        dEntStrikeCPS:-5.165382967155004
                    }, 
                    {
                        SharesOrdered:21097, 
                        dOppCostBP:0, 
                        SharesRemaining:0, 
                        dIVWAPCPS:-0.9433620460294358, 
                        name:"Buy", 
                        pid:"XXXXXX", 
                        cid:"XXXXXX^|^Buy", 
                        dOppCostK:0, 
                        dEntStrikeCPS:-0.7773018112938432
                    }, 
                    {
                        SharesOrdered:81713, 
                        dOppCostBP:28.193625377773973, 
                        SharesRemaining:19101, 
                        dIVWAPCPS:-2.1274640542024667, 
                        name:"Sell", 
                        pid:"XXXXXX", 
                        cid:"XXXXXX^|^Sell", 
                        dOppCostK:3.7382345275878905, 
                        dEntStrikeCPS:-3.4299416750724694
                    }
                ], 
                endRow:16, 
                invalidateCache:true, 
                isDSResponse:true, 
                queueStatus:0, 
                startRow:0, 
                status:0, 
                totalRows:17
            }
        ]
        I am returning the entire tree in the load on demand DSRequest and setting DSResponse.setInvalidateCache(true). What I see is the TreeGrid goes blank when the DSResponse is sent back?

        Comment


          #5
          This response looks generally fine. You should sanity check whether those data records would actually allow the tree to be populated, for example, for any given node being returned, are all of its needed parents present, including nodes that will appear at top-level with a parentId that matches the rootValue you're using?

          We're also checking on whether we can reproduce a general problem with invalidateCache and new tree nodes returned in a single response like this.

          Comment


            #6
            Yes, I checked to make sure the data being returned was indeed the entire tree that has been loaded and yes, all the records are there from the root node down.

            Comment


              #7
              We were not able to replicate a problem with the entire tree going blank on receiving an invalidateCache:true response.

              However, the intended & working behavior of invalidateCache:true is actually to invalidate the cache of children *just for the node that requested more children*, not the whole tree.

              So what we'd recommend doing if you want to drive cache invalidation based on server-side logic is to add a ResponseTransformer that notices the invalidateCache flag, creates a new ResultTree with the returned nodes, and applies that to the TreeGrid via setData().

              Note that, as the docs tell you, you shouldn't do this during the actual ResponseTransformer itself; it's sufficient to use the GWT Scheduler API to perform the action after a delay (any amount of delay is fine; the point is just not to take action synchronously during the response handling thread).

              Comment


                #8
                Originally posted by Isomorphic View Post
                We were not able to replicate a problem with the entire tree going blank on receiving an invalidateCache:true response.

                However, the intended & working behavior of invalidateCache:true is actually to invalidate the cache of children *just for the node that requested more children*, not the whole tree.

                So what we'd recommend doing if you want to drive cache invalidation based on server-side logic is to add a ResponseTransformer that notices the invalidateCache flag, creates a new ResultTree with the returned nodes, and applies that to the TreeGrid via setData().
                By creating a new ResultTree to replace the existing ResultTree, we will loose state maintained with the original ResultTree? Can we transfer the Open State from the old ResultTree to the new ResultTree and expect the Open State to be maintained?

                I have not seen any examples for creating a new ResultTree and using it with a TreeGrid. The docs that I have read (specifically the TreeDataBinding java docs) say that the ResultTree is created automatically for you when setting the DataSource in the TreeGrid.

                Originally posted by Isomorphic View Post
                Note that, as the docs tell you, you shouldn't do this during the actual ResponseTransformer itself; it's sufficient to use the GWT Scheduler API to perform the action after a delay (any amount of delay is fine; the point is just not to take action synchronously during the response handling thread).
                I cannot find what you are referring too in the docs about using ResponseTransformer? I checked the TreeDataBinding and ResponseTransformer java docs and did not see what you are referring to? Can you point me to where this is stated so I can read more about ResponseTransformer?

                So what you are suggesting is to create a ResponseTransformer and inside have a deferred command to:

                1. Create a new instance of ResultTree.
                2. Add the data (3rd param passed into RequestTransformer.transformResponse()) to the new ResultTree.
                3. Then replace the old ResultTree with the new ResultTree by doing a TreeGrid.setData(newResultTree).

                Is there anything I need to do resource wise like call a destroy() on the old ResultTree? Do I need to set the DataSource on the new ResultTree from the TreeGrid? It should not matter if my DataSource is a Dynamic DataSource?

                Code:
                ResultTree rt = new ResultTree();
                rt.setDataSource(treeGrid.getDataSource());
                Question - the 3rd parameter to RequestTransformer.transformResponse(), the Object data, how do I use JSOHelper to convert that Object to the required data type ResultTree.setData(TreeNode) is expecting?
                Last edited by JLivermore; 26 Sep 2014, 08:30.

                Comment


                  #9
                  Can we transfer the Open State from the old ResultTree to the new ResultTree and expect the Open State to be maintained?
                  Yes, you could do this with Tree.getOpenFolders() and openFolder().

                  I have not seen any examples for creating a new ResultTree and using it with a TreeGrid. The docs that I have read (specifically the TreeDataBinding java docs) say that the ResultTree is created automatically for you when setting the DataSource in the TreeGrid.
                  We're not sure what you mean by this. The docs do correctly state that a ResultTree is automatically created for you. But the docs do not say that you can't simply use the documented APIs of the ResultTree directly when it makes sense to do so..

                  I cannot find what you are referring too in the docs about using ResponseTransformer?
                  Notice the prominent link to DataSource.transformResponse at the beginning of the ResponseTransformer docs, explaining what ResponseTransformers are for - it's here that basic usage information is provided, including the advice about certain actions that would be unsafe (text that starts with red "NOTE").

                  So what you are suggesting is to create a ResponseTransformer and inside have a deferred command to:

                  1. Create a new instance of ResultTree.
                  2. Add the data (3rd param passed into RequestTransformer.transformResponse()) to the new ResultTree.
                  3. Then replace the old ResultTree with the new ResultTree by doing a TreeGrid.setData(newResultTree).
                  Right.

                  Is there anything I need to do resource wise like call a destroy() on the old ResultTree?
                  No.

                  Do I need to set the DataSource on the new ResultTree from the TreeGrid?
                  Yes. Creating a ResultTree always requires a DataSource.

                  It should not matter if my DataSource is a Dynamic DataSource?
                  No. None of the client-side code is even aware the DataSource was dynamically generated.

                  Question - the 3rd parameter to RequestTransformer.transformResponse(), the Object data, how do I use JSOHelper to convert that Object to the required data type ResultTree.setData(TreeNode) is expecting?
                  It's an Array of ListGridRecord, and TreeNodes can be created from ListGridRecord.

                  Comment


                    #10
                    does the ResultTree setup look ok?
                    Code:
                        private Object requestTransformerData;
                        private Timer timer = new Timer() {
                            @Override
                            public void run() {
                                JavaScriptObject[] items = JSOHelper.toArray((JavaScriptObject)requestTransformerData);
                                TreeNode[] objects = new TreeNode[items.length];
                                for (int i = 0; i < items.length; i++) {
                                    JavaScriptObject componentJS = items[i];
                                    TreeNode obj = TreeNode.getOrCreateRef(componentJS);
                                    objects[i] = obj;
                                }
                    
                                ResultTree resultTree = new ResultTree();
                                resultTree.setData(objects);
                                resultTree.setDataSource(treeGrid.getDataSource());
                                resultTree.setOpenState(treeGrid.getOpenState());
                    
                                treeGrid.setData(resultTree);
                                GWT.log("new ResultTree added to treeGrid.");
                                requestTransformerData = null;
                            }
                        };
                        private void deferredCommandScheduler(Object data) {
                            GWT.log("PivotTableGrid.deferredCommandScheduler()");
                            requestTransformerData = data;
                            timer.schedule(1);
                        }
                    
                        private class TreeGridResponseTransformer extends ResponseTransformer {
                    
                            @Override
                            protected void transformResponse(DSResponse response, DSRequest request, Object data) {
                                if(response.getInvalidateCache()) {
                                    GWT.log("TreeGridResponseTransformer response.invalidateCache()");
                    
                                    deferredCommandScheduler(data);
                                }
                            }
                        }

                    Comment


                      #11
                      We see no obvious errors.. Are you not getting the result you want?

                      Comment


                        #12
                        I see a lot of node ID collisions in the client log. Does order matter for these calls?
                        Code:
                                    resultTree.setData(objects);
                                    resultTree.setDataSource(treeGrid.getDataSource());
                                    resultTree.setOpenState(treeGrid.getOpenState());
                        The node ID collision messages have the resultTree.setOpenState(treeGrid.getOpenState()) in the stack traces?

                        I also have the treeGrid configured to
                        Code:
                        treeConfig.setReportCollisions(Boolean.FALSE);
                        Last edited by JLivermore; 29 Sep 2014, 15:10.

                        Comment


                          #13
                          Order should not matter. Can you:

                          1. show the log messages you're seeing. It's best to go ahead and proactively post any kind error messages you have questions about

                          2. let us know if you're having any actual functional issue, as opposed just being worried about warning messages

                          Comment


                            #14
                            Here is the client error I am seeing, this is the first time I do a TreeGrid.invalidateCache():
                            Code:
                            ERROR: 10:17:08.716:WARN:ResultTree:isc_ResultTree_1 (created by: undefined):Adding node to tree with id property set to:ONE TWO THREE. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false.
                            com.smartgwt.client.core.JsObject$SGWT_WARN: 10:17:08.716:WARN:ResultTree:isc_ResultTree_1 (created by: undefined):Adding node to tree with id property set to:ONE TWO THREE. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false.
                            	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                            	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                            	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                            	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
                            	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
                            	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.smartgwt.client.widgets.tree.ResultTree.create(ResultTree.java)
                            	at com.smartgwt.client.core.BaseClass.createJsObj(BaseClass.java:165)
                            	at com.smartgwt.client.data.RecordList.getOrCreateJsObj(RecordList.java:91)
                            	at sun.reflect.GeneratedMethodAccessor76.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.invokeNativeVoid(ModuleSpace.java:304)
                            	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                            	at com.smartgwt.client.widgets.tree.ResultTree.setOpenState(ResultTree.java)
                            	at com.anstca.tz.client.floater.pivottable.view.PivotTableGrid$3.run(PivotTableGrid.java:978)
                            	at com.google.gwt.user.client.Timer.fire(Timer.java:140)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                            	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:347)
                            	at sun.reflect.GeneratedMethodAccessor46.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)
                            This first error has the call to resultTree.setOpenState(treeGrid.getOpenState()) in the stack trace.

                            This next stack trace is when I do a TreeGrid.invalidateCache() for the second time, the TreeGrid is no longer sending a DSRequest after the TreeGrid.invalidateCache() call. It appears the TreeGrid is no longer responsive:
                            Code:
                            ERROR: 10:26:29.535:pointerup2:WARN:ResultTree:isc_ResultTree_1 (created by: undefined):Adding node to tree with id property set to:ONE TWO THREE. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false.
                            com.smartgwt.client.core.JsObject$SGWT_WARN: 10:26:29.535:pointerup2:WARN:ResultTree:isc_ResultTree_1 (created by: undefined):Adding node to tree with id property set to:ONE TWO THREE. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false.
                            	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                            	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                            	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                            	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
                            	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
                            	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.invokeNativeVoid(ModuleSpace.java:304)
                            	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                            	at com.smartgwt.client.widgets.grid.ListGrid.invalidateCache(ListGrid.java)
                            	at com.anstca.tz.client.floater.pivottable.view.PivotTableGrid.invalidateCache(PivotTableGrid.java:176)
                            	at com.anstca.tz.client.floater.pivottable.controller.ModelMediator.updatePivotTableAndInvalidateCache(ModelMediator.java:91)
                            	at com.anstca.tz.client.realtime.ui.RealTimeEquitiesPivotTablePlugin$3.onClick(RealTimeEquitiesPivotTablePlugin.java:186)
                            	at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:110)
                            	at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.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.smartgwt.client.core.DataClass.fireEvent(DataClass.java:506)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                            	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:347)
                            	at sun.reflect.GeneratedMethodAccessor46.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)
                            This error is being triggered on TreeGrid.invalidateCache() call. In this use case, we will be calling TreeGrid.invalidateCache() to update the tree periodically.
                            Last edited by JLivermore; 30 Sep 2014, 11:12.

                            Comment


                              #15
                              We may ultimately need a test case here, as these are senseless results.

                              To check on one possibility: if you are going to be creating a new ResultTree by hand and applying it via setData(), you should no longer be calling invalidateCache(). Calling invalidateCache() would just cause the *old* ResultTree (which you about to replace and discard) to initiate a data fetch, and would potentially wedge the TreeGrid, since it's in the middle of managing invalidation of the old data model when you suddenly provide a new one via setData().

                              Comment

                              Working...
                              X