These model/viewer classes are used when you want to design a frame that contains a tree view that shows all the levels of a data set hierarchy.
These model/viewer classes can be used in a SAS/AF frame by installing the classes and adding the Tree Viewer Control and Data Set Levels as Tree View Nodes Model classes to the Components tab. To instantiate the class during build, drag the class from the components tab and drop it into a frame.
Note: During build you typically drag a viewer onto the frame and a model onto the viewer. For some reason, subclasses of the Tree View Control do not automatically hookup the model and viewer. You will have to drag each component to the frame and make the hookup manually.
The classes contains these attributes that should be edited for each specific use.
Tree Viewer Control Model/View: model (from the drop down list, select an instance of the Data Set Levels as Tree View Nodes Model) Data Set Levels as Tree View Nodes Model Misc: dataSet (use the Value ellipsis ... to select from a dialog) variables (use the Value ellipsis ... to select a list of variables to define the hierarchy) nodeValueMode (either formatted or raw)
Special Note: Each node delivered by the model contains a userData item of type list. The list contains all contributing raw data values for a given formatted value shown in a node. This information is handy when implementing context processing on a node click.
Use the customizer [ click on the value ellipsis (...) button of attribute (custom) ] to select the dataSet and list of variables comprising the hierarchy. The customizer (common.components.variableselector.frame) works for any class containing attributes dataSet(char) and variables(list)
Here is an example of how the customizer can be made available to the
user at runtime when the user right clicks on the tree viewer:
- override the _onPopUp method of the Tree Viewer
- insert this code as the method override:
onPopup: method objectId : object ; call display ('common.components.variableselector.frame', _self_.modelID); endmethod;
Developers can easily surface control of dataset and variable to users through other model/viewers and linkages. (e.g. Data Set List Model / List Box and link the Data Set Levels as Tree View Nodes Model dataSet to the List Box selectedItem.)
There are eight catalog entries that are designed to be installed in the catalog common.components. The components for use in build are treeviewer_c and datasetlevels_c.
The use of these classes can be made more visually appealing by allowing the developer to control what open and closed icons are to be shown at each node. A method getNodeIcon (with arguments supplying the dataset name, level variable and depth, and value of variable) will be added as a hook for context sensitive icons. The developer will override this method and based on the inputs, return which icons should be used.
Example use: Suppose you had a furniture level with values chairs, tables, and beds. The getNodeIcon method would return the icon number for a chair, table or bed.
Asynchronous population of the tree view. If the Data Set is tremendously large, it is unconscionable to make a user wait while the model reads the entire table. The tree view should be updated every 1 or 2 seconds, or every N levels encountered. This one is going to take some hard thinking and probably dead end at non-existence of AF manageable threads in a SAS session.
The customizer is a frame, it would be a nice reuseable component (common.components.variableselector_c.class) if the functionality was placed within a composite class. The customizer would then be converted to a frame containing only this new component.Copyright 2000 Richard A. DeVenezia This page was last updated 13 December 2001.