[Zope] Tree tag cookie questions
Dunigan, Craig
craig.dunigan@esker.com
Thu, 24 May 2001 16:48:27 -0500
I realize that Zope doesn't save the tree state, but that the browser does,
sorry I wasn't clearer. The problem is that we have many pages generating
what appears to the user to be the same tree, which of course it isn't. I'm
using Yihaw, which gives me a 'Yihaw Folder' class that has an index_html
containing this code (I root the tree at BASE3 because that's where all the
Yihaw folders start living):
<dtml-tree expr="REQUEST.resolve_url(BASE3)"
branches_expr="objectValues('Yihaw Folder')" nowrap="1" sort="title">
<a href="&dtml-absolute_url;">
<img src="/Images/FolderIcon.gif" border="0"> <b><dtml-var
title_or_id></b>
</a>
</dtml-tree>
A user hits /folder1, generates a tree, modifies the tree state and gets a
cookie. Then he hits one of the links above, goes to /folder1/folder2,
generates a new tree, but with the state saved in the cookie. If he
modifies the tree state yet again, does he get a new cookie, obliterating
the previous tree state, or does the same cookie get modified, saying "for
page /folder1/index_html the tree state is 'x', for page
/folder1/folder2/index_html the tree state is 'y'?" My users seem to expect
that they can return to a page and have whatever tree state they "saved" on
that page reappear, and reading what you just wrote, I don't think that's
true, is it? Obviously, it isn't happening, but it _appears_ (key concept!)
that it is happening at some times and not others, and I'm trying to find
out if it _can't_ happen, or if I did something wrong.
Craig Dunigan
Web Programmer
Esker Software - Extending the Reach of Information
mailto:craig.dunigan@esker.com
Ph. 608.273.6000
Fax 608.273.8227
http://www.esker.com
> -----Original Message-----
> From: Michel Pelletier [mailto:michel@digicool.com]
> Sent: Thursday, May 24, 2001 4:28 PM
> To: Dunigan, Craig
> Cc: 'zope@zope.org'
> Subject: Re: [Zope] Tree tag cookie questions
>
>
> On Thu, 24 May 2001, Dunigan, Craig wrote:
>
> > At exactly what point does Zope send a cookie for the tree
> tag? It seems
> > that it does so when the user expands or contracts the
> tree, but am I right
> > about that?
>
> Yes anytime the visual state of the tree changes, it sends a new
> value for the 'tree-s' cookie.
>
> > And does Zope save tree state for each and every page visited,
> > if they all have a tree?
>
> No, the *browser* saves the tree state. That's what the
> cookie is for.
>
> > In multiple cookies, or just one big cookie it
> > keeps modifying?
>
> There is just one cookie named 'tree-s', and it can only hold the
> state for one tree. This is why you cannot have two trees in the same
> document.
>
> > Is there perhaps a limit somewhere to how many tree states
> > Zope can save for a single session?
>
> Once again, Zope doesn't save the state, that's what the
> cookie is for.
>
> > Obviously, I'm having trouble with the tree tag behavior,
> but I might figure
> > it out on my own if I can get some of these answers. Thanks.
>
> What's the trouble? You haven't described your problem.
>
> -Michel
>