forgot one thing

//add this before the return
treeModel.setTreeState(treeState);


William Huang
Product Development Team

IntraLinks, Inc.
99 Bedford Street
Boston, MA 02111
t 617 648 3511
f 617 648 3550
[EMAIL PROTECTED]
                                                                           
             William Huang                                                 
             <[EMAIL PROTECTED]                                             
             s.com>                                                     To 
                                       "MyFaces Discussion"                
             08/18/2006 01:51          <[email protected]>          
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: How to save tree2 state         
                 "MyFaces                                                  
                Discussion"                                                
             <[EMAIL PROTECTED]                                             
                 ache.org>                                                 
                                                                           
                                                                           




sure if your facelet code looks like this
<t:tree2 value="#{treeBean.treeModel}" ..>
..
</t:tree2>

your bean code

public class TreeBean {
  private TreeModel treeModel;
  private String[] expandedNodes;

  //you need to populate the expandedNodes string array
  ...
  pulic TreeModel getTreeModel() {
    TreeState treeState = new TreeStateBase();
    treeState.setTransient(true);
    treeState.expandPath(expandedNodes);
    return treeModel
  }

}

William Huang
Product Development Team

             Gus
             <[EMAIL PROTECTED]
             om>                                                        To
                                       [email protected]
             08/18/2006 01:17                                           cc
             PM
                                                                   Subject
                                       Re: How to save tree2 state
             Please respond to
                 "MyFaces
                Discussion"
             <[EMAIL PROTECTED]
                 ache.org>







Hi William,

Thank you sooo much for your reply and good idea. Yes, I had
clientSideToggle set false and true, but both of them could not solve the
problem. That is a good idea to use the TreeState. Could you please give me
a little detail codes to show how to use it? Thank you very much.
Best regards,
Gus

William Huang-2 wrote:
>
> do you have clientSideToggle set to true or false?  I experience that
> before, I had to use the TreeState in the manage bean to preserve
expanded
> or clopse nodes.
>
>
> William Huang
>
--
View this message in context:
http://www.nabble.com/How-to-save-tree2-state-tf2127303.html#a5873917
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and
may be privileged. If you are not the intended recipient, please notify the
sender immediately by replying to this email, and destroy all copies of
this email and any attachments. Thank you.


Disclaimer: This electronic mail and any attachments are confidential and may 
be privileged. If you are not the intended recipient, please notify the sender 
immediately by replying to this email, and destroy all copies of this email and 
any attachments. Thank you.

Reply via email to