Show TOC

DEMO_CONTEXT_MENU_DYNAMICLocate this document in the navigation structure

Use

The example application DEMO_CONTEXT_MENU_DYNAMIC demonstrates what options are available in the dynamic variant of the context menu.

A Table with flight information is displayed in the example application.

Process

When you call the context menu from a line, first of all the application clarifies where the context menu was called from (in this example all Table columns begin with FLIGHTS_TABLE_, which is sufficient as a criterion). Then the context menu is created dynamically and the application checks whether the flight can be booked (flight date is in the future and seats are available). If the flight can be booked, the context menu entry is set to enabled. If not, the entry is set to disabled. This all happens when the hook method WDDOONCONTEXTMENU is called.

In the application a context menu appears that consists of the application entry and the system entries (personalization and field help entries). If you have opened the context menu for a bookable flight, the Book Flight entry is also enabled, otherwise the entry is disabled. When you click the Book Flight context menu element, you go to the relevant action handler ( ONACTIONCONTEXT_MENU_ACTION) in the application. Not much else happens in this example application; only a Booking Confirmation is displayed, without actually making a booking.

Comments

  • Only a context menu can be returned. This can consist of several entries. UI elements are available for menus (you can nest one menu in another), submenus, action items, CheckBox es, RadioButton s, and separators.

  • Actions that are called when an option is selected in the context menu send standard event parameters (so a CheckBox item also sends its CHECKED value in the action handler).

  • The system menus (for personalization and input help) are automatically included.