Thanks Andrew and Bill for the suggestions. I thought Andrew's idea was great and I went ahead and tried it. It worked well. But I could not get the screen to refresh right after the user click the radio button. I set up break points in the getChildren() and getChildrenCount() methods, and found that they called countless times. I decided it is safer to update tree data instead.
Thanks a lot for sharing. Jane -----Original Message----- From: William Huang [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 11:19 AM To: MyFaces Discussion Subject: Re: Tree2- how to hide a branch that or since this is more of a business logic, you might want to apply the access logic before populating the tree model. That way is more of a business logic and UI separation. Bill "Andrew Robinson" <andrew.rw.robins [EMAIL PROTECTED]> To "MyFaces Discussion" 10/18/2006 10:52 <[email protected]> AM cc Subject Please respond to Re: Tree2- how to hide a branch "MyFaces Discussion" <[EMAIL PROTECTED] ache.org> You can do it via code in a custom tree node. Just don't return the node you don't want to show in the getChildren() method and don't count it in the getChildCount() method. AFAIK, there is no way to do it in the XHTML/JSP. On 10/18/06, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote: > I need to hide a branch of a tree for certain users due to configuration. I tried to use something like this > > <f:facet name="Test Folder"> > <h:panelGroup rendered="#{node.render}"> > .... > </h:panelGroup> > </f:facet> > > I could only hide a node this way, the little + sign still shows and can be clicked to show the branch under this node. What's a better way for hide a branch? > > I'd like to leave my tree data alone since it is shared by all users. This is just a display option. > > Thanks, > > Jane > 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.

