You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kleks Oren <Or...@tadirantele.com> on 2005/07/10 18:36:21 UTC

Saving Tree Component state

Hello,

I am new to myFaces. I have a question regarding state saving. 
I have a <x:tree> component in a page. I navigate from this page to other pages. When I go back to the page I want the tree nodes and path to be opened just as they were before.

Before I leave the tree page I save the tree state:
        UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
        HtmlTree htmlTree = (HtmlTree) root.findComponent(HTML_ROOT_ID);
	  oldState = htmlTree.saveState(FacesContext.getCurrentInstance());

I want to set the state again before I enter the page again.
What is the proper way to do this setting?

Regards,
Oren