How to configure a menubar in a user portal using navigation rules
As of PRPC 6.1, you can define the structure and content of a menu bar using a navigation rule. In this example, a menu bar is added to a section that provides access to several common local actions. This implementation is useful inside a screen flow.
The runtime menu structure is:
- Transfer (no action)
- Transfer
- Advanced Transfer
- Transfer to Manager
- Attach a Note
- Send Email
Update: For special situations or when working in PRPC 5.5, you can use hand-crafted XML to configure a menu bar. See How to create a menu bar using an XML Stream rule. However, in V6.1+ as a best practice, use a navigation rule.
Suggested Approach
Define the navigation rule as follows:
- Create a new navigation rule in the same class as the section rule to which it will be added. In this example, the Applies To class is AlphaCorp-OrderEntrySystem-PurchaseOrder and the navigation rule is called MenuBar.
- Each node in the navigation rule represents an option in the menu bar. The Action value on the node determines the onclick behavior of the menu bar item.
Double-click the initial node to access the Node Details panel. Edit the label and leave the Action as None to create the parent "Transfer" node. - Complete the Node Details panel for each remaining node. The selected Local Action is located starting from the value in the Class Name field. For more information about navigation rules, and other available Action values, see the Help system.
- To nest the Transfer action nodes under the parent node, click and drag the child nodes on to the parent node, as shown. Save the navigation rule.
The Editor tab of the finished navigation rule appears as shown:
Add the Menu Bar control to the section as follows:
- In the desired section rule, drag a Menu Bar control from the Advanced control panel into an empty layout cell. In the Cell Properties panel, access the MenuBar Display Format parameters by clicking the magnifying glass icon.
- In the Parameters Window, specify the class and navigation rule name created previously.
- At run time, the menu bar displays as shown here: