You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Costa Basil <co...@yahoo.ca> on 2007/02/28 04:27:28 UTC

tree2 doesn't remember the toggle status between requests for some nodes

Hi:

I have this odd problem with tree2 which started to occur after I upgraded to a Tomahawk 1.1.5 snapshot, a few weeks ago.

My tree contains a root with 37 children, each of these children having one or two other children. 

When I display the page I expand all the nodes programmatically by calling tree.expandAll();

In my page I have:

                  <t:saveState value="#{bean.treeData}"/>

                  <t:tree2 id="tree1"
                           binding="#{bean.tree}"
                           value="#{bean.treeData}"
                           var="node" varNodeToggler="t"
                           imageLocation="../../images/tree"
                           javascriptLocation="../../js"
                           clientSideToggle="true" >

treeData is a TreeModelBase object.

Now, the problem is that after I post back to the same page, some of the nodes are collapsed. The first 16 root children are expanded, the rest are collapsed.

Has anyone seen this?

Thanks

 				
---------------------------------
Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice

Re: tree2 doesn't remember the toggle status between requests for some nodes

Posted by Costa Basil <co...@yahoo.ca>.
Just to be precise, I didn't mean at the encoding time, I meant before the page gets rendered.

Costa Basil <co...@yahoo.ca> wrote: After I dug up more, I think it is because of bloody node toggle state cookies! The nodes toggle statuses are saved under a cookie with the same name as the tree id. If I use the same id in two different pages then they get mixed up. And this is what happened to me.

I could not find though where is the cookie value set when the tree is rendered. Shouldn't the cookie value be set when the tree is encoded in order to reflect the structure in the memory?



Costa Basil <co...@yahoo.ca> wrote: Hi:

I have this odd problem with tree2 which started to occur after I upgraded to a Tomahawk 1.1.5 snapshot, a few weeks ago.

My tree contains a root with 37 children, each of these children having one or two other children. 

When I display the page I expand all the nodes programmatically by calling  tree.expandAll();

In my page I have:

                  <t:saveState value="#{bean.treeData}"/>

                  <t:tree2 id="tree1"
                            binding="#{bean.tree}"
                           value="#{bean.treeData}"
                           var="node"  varNodeToggler="t"
                           imageLocation="../../images/tree"
                           javascriptLocation="../../js"
                           clientSideToggle="true" >

treeData  is a TreeModelBase object.

Now, the problem is that after I post back to the same page, some of the nodes are collapsed. The first 16 root children are expanded, the rest are collapsed.

Has anyone seen this?

Thanks
          

---------------------------------
Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada  Messenger with Voice
    

---------------------------------
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. 

 		
---------------------------------
Share your photos with the people who matter at Yahoo! Canada Photos

Re: tree2 doesn't remember the toggle status between requests for some nodes

Posted by Costa Basil <co...@yahoo.ca>.
After I dug up more, I think it is because of bloody node toggle state cookies! The nodes toggle statuses are saved under a cookie with the same name as the tree id. If I use the same id in two different pages then they get mixed up. And this is what happened to me.

I could not find though where is the cookie value set when the tree is rendered. Shouldn't the cookie value be set when the tree is encoded in order to reflect the structure in the memory?



Costa Basil <co...@yahoo.ca> wrote: Hi:

I have this odd problem with tree2 which started to occur after I upgraded to a Tomahawk 1.1.5 snapshot, a few weeks ago.

My tree contains a root with 37 children, each of these children having one or two other children. 

When I display the page I expand all the nodes programmatically by calling tree.expandAll();

In my page I have:

                  <t:saveState value="#{bean.treeData}"/>

                  <t:tree2 id="tree1"
                            binding="#{bean.tree}"
                           value="#{bean.treeData}"
                           var="node" varNodeToggler="t"
                           imageLocation="../../images/tree"
                           javascriptLocation="../../js"
                           clientSideToggle="true" >

treeData  is a TreeModelBase object.

Now, the problem is that after I post back to the same page, some of the nodes are collapsed. The first 16 root children are expanded, the rest are collapsed.

Has anyone seen this?

Thanks
          

---------------------------------
Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice

 		
---------------------------------
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers.