This is sample tree for representing "Offices --> Employees" data structure.
I want to have emplyees loaded in lazy way - so I introduced the loadEmplyeesIfNeeded expand listener.
Everything works well except one thing. The employees are loaded after the office node is expanded.. So when the tree is rendered all offices don't have any employee and are rendered as leafs.. And of course leafs can not be expanded....

To make long store short. Is there any way to set that the node should be rendered as node (with possibility to expand) despite having no children?
The best would be if rich:treeNode would have some attribut like isNode but it doesn't..

b.t.w. I could solve it by just adding to every office an fake employee at the initialization of offices.. But that's not very nice work around...

You can do this using OpenFaces TreeTable if you don't mind adding another library to your application. Lazy loading can be implemented just by adding the preloadedNodes="none" (or prelodedNodes="levelsPreloaded:1") to <o:treeTable> tag, and it will also automatically detect whether the node's expansion toggle should be displayed. OpenFaces TreeTable is quite customizable and it shouldn't necessarily look as a multi-column table, but it can be shown as a simple tree as well (e.g. see this page)

Here's how such a TreeTable can be declared (you might actually need more customizations, but this example shows the idea):

The treeTableBean.nodeChildren method should take the value of the "node" variable, and return its child nodes (or return root nodes if its value is null). Here's how this method might look in your case: