You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Wolf Benz <eu...@gmail.com> on 2006/05/26 15:45:41 UTC
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="#
{SearchControllerBean.treeController.treeData}"
...
<f:facet name="document">
</f:facet>
</t:tree2>
...(code:)
treeData = new TreeNodeBase("root-folder", "All", false);
TreeNodeBase catNode = new TreeNodeBase("categories",
"folder1", false);
catNode.getChildren().add(new TreeNodeChecked("document",
"doc1, true, true));
...
treeData.getChildren().add(catNode);
catNode = new TreeNodeBase("categories", "folder2", false);
catNode.getChildren().add(new TreeNodeChecked("document",
"doc5", true));
...
treeData.getChildren().add(catNode);
------------------------------
--> 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?
e.g.
<facet name="categories">
<t:graphicImage value="blue-folder-closed.png" border="0"/>
<facet name="subCategories">
<t:graphicImage value="yellow-folder-closed.png" border="0"/>
...
</facet>
</facet>