In this exercise we will create a new Menu Object, that we will use to configure the application’s menu. After the menu is created, we will initialize the menu’s content using information extracted from the KB.
To do this, follow these steps:
- Open the “New Object” dialog in GeneXus (Ctrl + N), and select “K2BMenu” object type. Name this object K2BMainMenu.
|
K2BMenu object creation |
- We now have an empty menu. To initialize it, use the “Scan Menu” located in the specification tree’s root node.
|
Scan Menu action |
This action will scan the contents of the KB, and will include all the web panels generated with K2BTools that have the “Include In Menu” property set to True. After the action is executed, the tree should look like this.
|
Scan Menu action result |
- Save and apply the pattern instance.
|
Applying K2BMenu Pattern |
- See how the pattern generates a new procedure, called K2BMainMenuStaticMenuLoader.
|
Generated Static Menu Load Procedure |
- Open K2BGetUserMenu procedure and add the following code:
|
Menu Items |
|