[Zope] Tree tag cookie questions

Michel Pelletier michel@digicool.com
Thu, 24 May 2001 15:09:16 -0700 (PDT)


On Thu, 24 May 2001, Dunigan, Craig wrote:

> <dtml-tree expr="REQUEST.resolve_url(BASE3)"

You shouldn't use REQUEST.resolve_url.  Use restrictedTraverse instead.

> branches_expr="objectValues('Yihaw Folder')" nowrap="1" sort="title">
>   <a href="&dtml-absolute_url;"> 
>     <img src="/Images/FolderIcon.gif" border="0">&nbsp;<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'?"

The former: the old cookie gets obliterated.  There is only one 'tree-s'
cookie, and it can only hold the state for one tree, the last tree viewed
by the user.

> 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? 

Nope.

> 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.

When it apears to happen, it may just be a caching issue.

I'm sure you could try and extend the tree cookie to be more
all-encompasing as you described above.  This would have the upshot of
allowing two trees on the same page.

-Michel