Hi Alf,

I've some questions:
Which Tobago version and which JSF implementation and version you are using (and which container)?
In which scope is the managed bean that holds the state?

I don't exactly know what happens, because I've not the sources of you code.
But I can try some supposition...
The usual usage of Tobago is to write an application, with one or more pages that will be called by clicking on some controls on the page. It was a difference of calling the URL and clicking a <tc:button>. The click on a button will submit the current expansion state of the tree and sends it to the server (via a hidden input field), which manipulates the tree state object. When calling the URL (manually) the expansion state information is not part of the request. When JSF now restores the UIViewRoot and begins to decode the request it clears the expand state and tries to apply the new information from the browser (which are not available in this case).

It is correct, that you want to provide external links (non faces request to faces response)? Are you also use "internal" actions? If not, you don't need to save the expansion state for each user. You can try to put the tree state in the "none" scope.

Regards,

Udo

Am 15.06.10 15:51, schrieb Alf Felis:
Any idea?

-------- Original-Nachricht --------
Datum: Thu, 03 Jun 2010 13:31:44 +0200
Von: "Alf Felis"<alf.fe...@gmx.de>
An: MyFaces Discussion<users@myfaces.apache.org>
Betreff: [Tobago] Problem using tc:tree and request parameters

Hi all,

I have a problem with tc:tree.
In my code I expand the tree after creation using the TreeState:

state.expand(tree, 1);

This works fine till I use a request parameter... e.g.

http://localhost:8080/Tobago/faces/TobagoTreeTest.jsp?param=123

In this case the first/initial call will show an expanded tree... the second 
call shows a collapsed tree.

-------------------------------------
first and second call with parameter:
-------------------------------------
1.) Call the URL ->  tree expanded
2.) Reload the URL ->  tree collapsed

-------------------------------------
first call with, second without parameter:
-------------------------------------
1.) Call the URL ->  tree expanded
2.) Call http://localhost:8080/Tobago/faces/TobagoTreeTest.jsp ->  tree expanded
3.) any call/reload without parameter ->  tree expanded

I figured out that the method 'TreeState.clearExpandState()' will be called, 
but I can't find any hints on that issue.


Regards, Alf

Reply via email to