Display the Genero context menu

This procedure shows how to display the Genero context menu when the user right-clicks on the Genero application.

About this task

When you right-click on your GBC application, the context menu that displays can be either the browser context menu or the Genero context menu. By default, it is the browser context menu (see Figure 1).

Set the Genero context menu, using either of the following methods:

  • If you want to add this feature for all applications using your GBC project, add a customization as described in this task.

  • Alternatively, if you just want to add this feature for a session, add the contextmenu=1 in the application URL query string parameter.

    For example, to launch the demo application using a customization named "sample" and with the Genero context menu activated instead of the browser context menu, open the URL for your GAS in a browser:
    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

Figure: Application with browser context menu


If you set the theme-disable-context-menu variable to FALSE, the Genero context menu will display instead (see Figure 2).

Figure: Application with Genero context menu


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.

  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. To disable the browser context menu and enable the Genero context menu, set the theme-disable-context-menu variable to false:
    // in theme.scss.json
    {
      ...
      "theme-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, see Selecting customizations and themes.