1
votes

So our app is set up like the standard left frame with the tree, right frame has the main content (loaded from clicking the tree).

Our web app inconsistently displays a blank page in the main frame in Firefox. By inconsistent I mean everyday for a few, rarely for others, never for most. Once we get this, going to any other page through our tree results in a blank page. We found that deleting the "aTreeSaveStateCookie" restores normal operation. "aTree" is the name of our Div. I found "SaveStateCookie" strings in dijit/Tree.js.

This also happens in IE, except I would get a browser error page which I can't recall right now. I would then delete the only cookie I could find for our app (not sure how to do the Firefox steps in IE)

Any ideas on why this would happen?

Thanks

Dojo 1.3 through http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js
Firefox 3.1x
IE 8
Windows XP
In my case, I don't recall ever changing browser settings around Private Data.

2
Does this happen when they bring up the page for the first time? Or does it happen after they've been slogging away on it for awhile? Also, does the datastore change from one session to the next? - seth
It happens after clicking around for a while. Not sure about the last question. Here's some more background: - The app runs as an iframe within a tab in a Liferay portal. However the problem can occur when I don't even leave the tab with the iframe - We have some java code to synchronize the Liferay http session and our app (J2EE/Struts) http session. Thanks - patlv23
More info: Firebug Net tab shows that the request is made but no response. Same thing with http sniffer. Checking the server logs show that no requests are received. If I open a new tab and type in a url of our app that doesn't load the tree, it works fine - request sent, response received. - patlv23
More info again. So one of our own js functions is called on a node's onClick. it has a "location.href = item.url;" line. This doesn't do anything while this problem is occurring. Also, when I try to sign back in to our app (the code of which never hits anything tree related), nothing happens too (request sent, no response) until the cookie is deleted. - patlv23
Sign in is actually the Liferay log-in page. Liferay just loads a url in our app to initialize the session. It's this url that doesn't get a response. - patlv23

2 Answers

0
votes

Please check to see if the response code is 413 (413 = request entity too large), usually this happens when the cookie(s) used to store the tree(s) expansion state (aTreeSaveStateCookie) exceed(s) the maximum request size for your server

You could try increasing the maximum request size (follow instructions for your specific web app server) or at least display a meaningful error message like "please clear your browser cache" when the 413 error code is encountered

0
votes

If the persist property is set to a truthy value, dijit.Tree is persisting its state to remember which nodes were expanded, and expand them after a page reload. If you need to persist the tree state in presence of a very large data structure, I recommend overriding Tree to use localStorage instead of dojo.cookie.

This is Dojo v. 1.9, but similar changes can be done to the non-AMD version 1.3

_saveExpandedNodes: function(){
   if(this.persist && this.cookieName){
      var ary = [];
      for(var id in this._openedNodes){
         ary.push(id);
      }
      // Was:
      // cookie(this.cookieName, ary.join(","), {expires: 365});
      localStorage.setItem(this.cookieName, ary.join(","));
   }
},

And:

_initState: function(){
   // summary:
   //    Load in which nodes should be opened automatically
   this._openedNodes = {};
   if(this.persist && this.cookieName){
      // Was:
      // var oreo = cookie(this.cookieName);
      var oreo = localStorage.getItem(this.cookieName);
      if(oreo){
         array.forEach(oreo.split(','), function(item){
            this._openedNodes[item] = true;
         }, this);
      }
   }
},