Ok. Tell me about the preserveToggle feature. Never used it. What is it for, and how does it work?

Now, there are 2 issues here. First of all, in the current way of doing things, we get 2 cookies, which is a major bug in my mind, that should be fixed. A possible fix is to use the context path as path for the cookie, instead of the page path. (see the JIRA).

Getting rid of the cookies is an entirely different issue (which I think should be investigated). The idea here is to have the tree2 render an extra hidden field. The JavaScript should be changed so that state is stored (e.g., in exactly the same manner as now) in the hidden field value instead of in a cookie. The tree2 renderer then gets the expanded state from the request parameter instead of from the cookie (not difficult), and writes the state on each render response. Inbetween, the state can be manipulated programmatically (yet another topic discussed here at libitum).


On 24 Sep 2005, at 2:16, Mathias Werlitz (JIRA) wrote:

[ http://issues.apache.org/jira/browse/MYFACES-616?page=comments#action_12330331 ]

Mathias Werlitz commented on MYFACES-616:
-----------------------------------------

getting rid of cookies would breake the preserveToggle feature in client side toggle mode :(

tree2 creates TWO cookies
-------------------------

Key: MYFACES-616
URL: http://issues.apache.org/jira/browse/MYFACES-616
Project: MyFaces
Type: Bug
Components: Tomahawk
Versions: Nightly Build
Reporter: Jan Dockx

Cookies for tree2 are generated by JavaScript, with as name the (simple) JSF id of the tree2 component, and as path the "current URL directory". However, in a normal JSF-to-JSF navigation, the first time the tree is rendered, we came from another page, and the URL is the URL of that previous page (in JSF, the URL is always 1 step behind). When we have server interaction within the page the tree is on, after the first interaction, the URL is changed to the URL of the second page, and a second cookie is created for that "URL directory". This is not an issue in itself if both pages are in the same directory, but becomes apparent if they are not.
This is probably hard to fix when looked at narrowly, because of the "URL is always 1 step behind" JSF issue. The real issue is, however, that the path of the cookie should be the webapp context, like JSESSIONID has, and not the "current URL directory". The viewId could then be made part of the cookie name, to make it unique.
(Or, for an even more bold suggestion: we should get writ of the cookies, and store the state in a hidden field. Cookies can be used for storing state across requests, but for tree2 that is exactly what we don't want: we want to get the info to the server, let the server define a new state, and then get that back.)

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


<x-tad-smaller>Met vriendelijke groeten,

Jan Dockx
</x-tad-smaller><x-tad-smaller>
PeopleWare NV - Head Office</x-tad-smaller>
<x-tad-smaller>
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66 </x-tad-smaller>
<x-tad-bigger>
</x-tad-bigger>
<x-tad-smaller>
PeopleWare NV - Branch Office Geel</x-tad-smaller>
<x-tad-smaller>
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25</x-tad-smaller>
<x-tad-bigger>
</x-tad-bigger>
<x-tad-smaller>
http://www.peopleware.be/
</x-tad-smaller><x-tad-smaller>http://www.mobileware.be/</x-tad-smaller>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to