VFW060 – Using a Tree View
Introduction to Tree Views
Tree view components are widely used in Windows applications. They usually present related information, with the tree visually representing the relationships as levels. For example folder, sub folders and files; or departments, sections and employees.
The VL Framework usually presents the navigation panel as a tree (it can in fact also be visualized as two lists or as a dropdown.
The Tree View Technically
The tree view component is specialized list component, which presents the list items as a tree.
The Visual LANSA Tree View component, by default has a Levelled.
property ofIn this case, each level can display one column only.
Each column added must have its correct Level number defined.
Each level must have a column which defines the KeyPosition for this level. For example, if level one is department description, then level one probably has DEPTDESC defined as 1. It defines the sequence of entries for level one. For example:
=
The above tree would be defined as follows:
SourceField |
Level |
KeyPosition |
DEPTDESC |
1 |
1 |
SECDESC |
2 |
1 |
FULLNAME |
3 |
1 |
- Note that the order added is not related to how an entry is visualized in the tree view.
- Each value of DEPTDESC is displayed once, at level 1 and in sequence.
- If the tree is to show all departments from the table DEPTAB and all sections for each department from the table SECTAB and all employees for each section, then it is essential to load:
a. the tree view entries from DEPTAB
b. all section's entries for each department from SECTAB
c. all employees for department and section from view PSLMST1.
Objective
- To build a simple three level tree view for all departments, sections and employees
- To build tree view with columns
- These exercises will be implemented as a standalone form, not within your Framework application.
In order to meet the objectives you will complete the following:
Step 2. Displaying Tree View Data.
Step 3. Add Fields to Tab Sheets and Item Got Selection logic.
Step 4. Fill the Tree View on Demand
Step 5. Add Icons to the Tree View
Before You Begin
Complete earlier list exercises, VFW050 and VFW052.