How to Make a Recursive Tree View

Previous Next

To make a recursive tree view:

1.Navigate to the tree view node that you want to make recursive.
All the child nodes of that tree view node will select the same kind of data. A single SQL query is used to display data a number of levels deep.
2.For the Child Nodes property of the tree view node, enter the name of the tree view node.
For example, for Tree View Node 1, set Child Nodes property to: Tree View Node 1.
3.You can specify a condition using the "treeLevel" keyword to limit the amount of recursion. The treeLevel keyword is preceded by a colon and surrounded by double quotes, like embedded method calls.
For example:

WHERE :"treeLevel" < 4

Example:

A tree view displays all sub-departments per department. The SQL Query of Tree View Node 1, the root node, is:

SELECT  dept_name

FROM    department

WHERE   super_department_name = :DEPT_NAME

 

The Child Nodes property of Tree View Node 1 is Tree View Node 1.

The :DEPTNAME embedded method call refers to the dep_name column values one level higher in the recursive tree.