How to Open a Window from a Tree View or List View

Previous Next

See Also

You can allow the user of a tree view or list view to open a window by double-clicking on an area of the tree view or list view.

You can make the new window display data corresponding to the current item in the tree view or list view.

To open a window from a tree view or list view and display corresponding data:

1. In the Windows Designer, open the window class that you want to open from the tree view or list view.
2. If you want to prevent the user from opening more than one instance of this window class at a time, set the Open Only Once property to Yes.
3. Define a property with the String type to receive the value from the tree view or list view.
4. Set the Post-Open property to:

QueryDefine()

query.<column name>(<user-defined property>() )

QueryExecute()

5. In the Windows Designer, open the window or dialog that contains the tree view or list view. In case of a tree view, navigate to the appropriate tree view node.
6. Using the Object Activator, set the Double-click Action property to:

<NewWindow>(<Tree/List View object>.GetValueFromCurrentItem( <column name> )).Window.Create()

where <column name> is the name of the output column queried by the SELECT list of the tree view's or list view's SQL Query.

For a detailed example, see Actions Example 10: Catalog Node Leading to Data Query.