Does TreeTable support lazy loading? I would like to display a very
large tree and want to lazy load the children when the user expands a
parent node. After reading the documentation I thought that the
RowDisclosureEvent could be used for this, but I don't readily see how.
This is what I have done so far:
// Set the treeModel and rowDisclosureListener for the tree table
<tr:treeTable var="node" value="#{treeTableBean.treeModel}"
rowDisclosureListener="#{treeTableBean.processRowDisclosureEvent}">
...
</tr:treeTable>
// Here's the bean method that returns the tree model
// ************ Just return the root node ***********
public TreeModel getTreeModel() {
if (treeModel == null)
{
TreeNodeVO root = getTreeService().getTreeNode("CORP");
treeModel = new ChildPropertyTreeModel(root, "children");
}
}
At this point I see a TreeTable on my page with just the root node, but
no arrow to expand it. So here are my questions:
1) Since the root node cannot be expanded, the rowDisclosureListener
will not be called. Even if it is called, how can I use the event to
lazily connect the children to the root node? How does the event tell me
what to fetch next and where to put this information?
2) Currently I have my bean in request scope. Does TreeTable, especially
with lazy loading, require the bean to be in the session scope?
Thanks for your help.
Naresh Bhatia