Display the Genero context menu

When the user right-clicks on their Genero application, a context menu displays; you can specify whether it is the browser context menu or a Genero context menu depends on a theme variable.

About this task

When you right-click on a Genero application your GBC application, the resulting context menu can be either the browser context menu or the Genero context menu. By default, it is the browser context menu.

Figure: Application with browser context menu


Figure: Application with Genero context menu


To display the Genero context menu, you have two options.

  • To add this feature for all applications, create a GBC customization.

  • To add this feature for the current session only, add contextmenu=1 as an application URL query string parameter. For example, to launch the demo application using a customization named "sample" and with the Genero context menu activated, use this URL:
    GAS 5.00 and greater
    http://localhost:6394/ua/r/demo?gbc=sample&contextmenu=1
    GAS prior to 5.00
    http://localhost:6394/ua/r/gwc-demo?gbc=sample&contextmenu=1

    For details about query string parameters, go to Query string parameters

If you

Before you begin

This procedure assumes you are comfortable updating theme parts and themes. For the basic principles behind themes and theme parts, see How customization works. For instructions about adding and modifying themes and theme parts, see Working with themes. For information about the underlying GBC infrastructure and its components, see Theme reference.

To display the Genero context menu when the user right-clicks on an application, set the gbc-disable-context-menu theme variable to FALSE.

  1. Identify the theme part you plan to update. If you are creating a new theme part, prepare the directory.
  2. In the theme part, open the theme.scss.json file in a text editor.
  3. Set the gbc-disable-context-menu variable to false:
    // in theme.scss.json
    {
      ...
      "gbc-disable-context-menu": false,
      ...
    }
  4. If you created a new theme part, add it to one or more themes.
  5. Save your changes and rebuild your customization using gbc build:
    $ gbc build --customization customization-project-dir
  6. Test that your changes work as expected.

    Open your application and right-click on the screen.

    Tip:

    You may need to use CTRL + F5 to clear the browser cache before you see your changes.

    If your tests do not behave as expected, ensure you are using your newly-built custom GBC. Depending on your development environment, you may need to package and deploy a custom GBC client. For information on which customization and theme you are using, go to Selecting customizations and themes.