|Custom TreeModel and TreeNode|
<rich:tree />examples. The modified code in these examples demonstrate how to use custom
TreeDataModelimplementations to make really nice and functional trees. The code for my generic
TreeNodesSequenceKeyModelare fully functional and can be used out of the box as the basis of your own tree implementations.
The examples include the model provided by RichFaces, my custom model (
TreeNodesSequenceKeyModel), and a custom implementation of a node. The custom node is generic so you can pass in any object you like. I chose to use text, but you could use a more complex object.
The custom model, custom node, and tree are shown in the image on the right. This also has events being shown when a node is selected, or toggled.
The project was developed using NetBeans along with Apache Maven.
The Mercurial project can be found on BitBucket here: richfaces-tree