myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Heinen" <>
Subject RE: TreeNodeChecked and t:treeCheckbox sample ?
Date Fri, 26 May 2006 14:29:02 GMT
Hi Wolf,

yes, I have this facet and did not have any problems.
Post your code, maybe s.o. can help you.

If you have more hierarchical facets then you don't need to nest them.
Just specify them. The nesting is done internally by processing the
children of the nodes. Of course you can use other images in the facets
or other styles for sublevel items.

See below sample:
My node types are "root", "category" and "document" and they must match
the facet names. Category is a subfolder of root. Document is an element
which can be below category or directly below root. It depends on the

<t:tree2 id="catTree" value="#{MyBean.myTree.treeData}" 

  <f:facet name="root">
          <h:outputText value="All" styleClass="nodeFolder"/>

  <f:facet name="category">
          <t:selectBooleanCheckbox value="#{node.checked}"
          <h:outputText value="#{node.description}"
          <h:outputText value=" (#{node.childCount})"
styleClass="childCount" rendered="#{!empty node.children}"/>

  <f:facet name="document">
          <t:selectBooleanCheckbox value="#{node.checked}"
            <h:outputText value="#{node.description}"/>



-----Original Message-----
From: Wolf Benz [] 
Sent: Freitag, 26. Mai 2006 15:46
To: MyFaces Discussion
Subject: Re: TreeNodeChecked and t:treeCheckbox sample ?

Hi Michael,

Thanks for this contribution!
I have a question with yr code:
Your setup is:

<t:tree2 id="serverTree" value="# 


<f:facet name="document">




       treeData = new TreeNodeBase("root-folder", "All", false);

         TreeNodeBase catNode = new TreeNodeBase("categories",  
"folder1", false);

         catNode.getChildren().add(new TreeNodeChecked("document",  
"doc1, true, true));



         catNode = new TreeNodeBase("categories", "folder2", false);

         catNode.getChildren().add(new TreeNodeChecked("document",  
"doc5", true));




--> From this , I understand (correct me if I'm wrong)

- the most inner element (the leafs of the tree; "document" in yr  
case) have a name that must match the "facet"-name inside tree2 AND  
match the "type" parameter of TreenNodeChecked.

My question:

You also have a "in-between" level: the "categories"-type. Yet you do  
not declare a facet for this. When I do that, I get a "Unable to  
locate facet with the name: categories"-exception.

Did you have this too & if so, how did you avoid it?

Plus, (extrapollating the question) is there a way to specify  
attributes for levels in between?

Suppose e.g. I wanted to have folders of depth 2 to be a blue folder- 
icon, of depth 3 a yellow icon, ... (to improve visibility), is the  
way to do this just by nesting facets?


<facet name="categories">

	<t:graphicImage value="blue-folder-closed.png" border="0"/>

	<facet name="subCategories">

		<t:graphicImage value="yellow-folder-closed.png"




View raw message