Use navigation attributes in action scripts
- Last UpdatedDec 06, 2024
- 3 minute read
This example explains how to use Navigation attributes in action scripts associated with a graphic to enable users to shift the context of a ViewApp to sibling navigation items, or return to the root level item in the navigation tree.
An example ViewApp is designed to show the mixing and storage areas of a plant, which contain reactors and tanks. Users need the capability to quickly drill down within the ViewApp to see the details of individual reactors and tanks.
In the Model view of the IDE, the Mixing and Storage areas are sibling items in the navigation hierarchy. The Mixing area contains four reactors, which are siblings of each other. The Storage area contains three sibling buildings. Each building contains a set of storage tanks, which are siblings of each other. During runtime, the ViewApp's NavTree control shows the hierarchical relationships of the different items in the navigation model.

Users need the ability to shift quickly between sibling views. Also, users need to be able to immediately navigate to the root item in the navigation tree that shows an overview of the entire plant operation.
The graphic near the top of the ViewApp containing left/right arrows and a home icon is the visual element the user interacts with to navigate between sibling views and show the plant overview. The left arrow shows the previous item in a set of sibling items. The right arrow shows the next item. The home icon shows the plant overview.

To set navigation pathways with Navigation attributes
-
Create a graphic containing left/right arrows and a home icon graphic element.


-
Select the Path element within the home graphic element to show the Edit Animations dialog box.
-
Select Action Scripts as the type of animation.
-
Enter a Navigation attribute expression to set the current navigation path to the root path.

-
Repeat steps 2-4 to set actions scripts for the left/right arrow graphic elements.
Right arrow

Left arrow

-
Save your changes to the graphic.