K2BTools Tutorial - Exercise 11.1 - Creating a Menu Object

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:

  1. Open the “New Object” dialog in GeneXus (Ctrl + N), and select the “K2BMenu” object type. Name this object K2BMainMenu.
    K2BMenuCreateObject
    K2BMenu object creation

  2. We now have an empty menu. To initialize it, use the “Scan Menu” located in the specification tree’s root node.
    ScanMenuActionTutorial
    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.
    ScanMenuActionResult
    Scan Menu action result

  3. Save and apply the pattern instance.
    ApplyingK2BMenuPattern
    Applying K2BMenu Pattern

  4. See how the pattern generates a new procedure, called K2BMainMenuStaticMenuLoader.
    GeneratedObjectsK2BMenu
    Generated Static Menu Load Procedure