Here is the proposal for the new tree component. I've attached two screen shots of our actual Tiles version of this component for reference (all data has been faked to protect the innocent.) The basically correspond to two different use cases.
Case #1 - Simple tree with an unspecified number of levels
There are probably plenty of cases where this would apply. This is
basically what the current tree component supports now. The new
version would support javascript on the client to expand and collapse
folders. The idea is that through the JSF tags, you would configure
the image for the "open" and "closed" branches as well as the "leaf"
image. These configuration settings would be applied as appropriate
to all nodes in the tree regardless of level.
Here is some sample JSF text that one might use to configure such a tree:
<x:tree>
<x:tree-config value="#{treeData}" var="node">
<f:facet name="branch-open">
<h:graphicImage value="/images/open-folder.gif"/>
<h:outputText value="#{node.description}"/>
</f:facet>
<f:facet name="branch-closed">
<h:graphicImage value="/images/closed-folder.gif"/>
<h:outputText value="#{node.description}"/>
</f:facet>
<f:facet name="leaf">
<h:graphicImage value="/images/document.gif"/>
<h:commandLink immediate="true" value="#{node.description}"/>
</f:facet>
</x:tree-config>
</x:tree>
Case #2 - Complex tree where developer needs control of some/all of
the levels in the tree
The second image shows a more complicated (and realistic) example. It
often will not suffice to have the same image for every branch in the
tree. It would be nice to be able to specify multiple <x:tree-config>
tags so you can customize the look of one or more branches in a tree.
In addition, I am thinking it would be cool if you could nest these
<x:tree-config> tags so that you could configure secondary levels of
the tree, etc.
The second case is obviously going to be complicated. I'd like to get
some general feedback on the proposed tags that I've shown for the
first use case. This is just a rough draft but I wanted to throw it
out there and see if I could get some feedback.
Also, would people be interested in this kind of tree in general? I'm
assuming the answer is yes (if done correctly.) But maybe I am alone
in these requirements. I have looked at the open source and
commercial offerings in this area and find them to be lacking this
kind of functionality.
TIA,
sean
<<attachment: tree-sample1.png>>
<<attachment: tree-sample2.png>>

