Show TOC

 ContextMenuProviderLocate this document in the navigation structure

The ContextMenuProvider allows applications to create their own context menus. The context menus are always defined on a view. To allow this, entry CONTEXT_MENUS is always available for each view, together with the ROOTUIELEMENTCONTAINER. Here, you can define your required context menu at runtime.

This menu is assigned to view elements as follows.Each view element has three options:

  • It inherits the context menu from its parent (in the containment hierarchy).
  • It hides its context menu.
  • It provides a context menu (defined in the view).

These three cases are expressed in the property contextMenuBehaviour .

A "provider" sets the property contextMenuId to the ID of its menu. To do this you need these two new properties in each (potential) provider. A provider can be:

  • Each UI element subclass
  • Several selected view element subclasses (TableColumn, Tab, etc)

Each UI element subclass is now automatically a (potential) provider. For the relevant view element subclasses the inheritance hierarchy has been changed so that it inherits from the ContextMenuProvider instead of from the ViewElement.

Note

The ContextMenuProvider is used for the static definition of context menus.To create context menus dynamically, methods WDONCONTEXTMENU and F_WD_CONTEXT_MENU_MANAGER (context menu manager) are provided. See also Dynamic Context Menus .

Example of the Visual Display

Display in the Application Display in View Designer

Runtime Class

CL_WD_CTX_MENU_PROVIDER

Properties in the View Designer

Name Type Initial Value Bindable

id

STRING

(automatic)

No

contextMenuBehaviour

WDUI_CONTEXT_MENU_BEHAVIOUR

inherit

No

contextMenuId

STRING

No

Other properties that can be inherited are defined in the associated higher-level classes. The associated UI elements are:

Dynamic Programming

For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. Bear in mind the different spellings.

Dynamic Programming of Properties

View Designer Name Runtime Name Type

contextMenuBehaviour

CONTEXT_MENU_BEHAVIOUR

WDUI_CONTEXT_MENU_BEHAVIOUR

 contextMenuBehaviour: inherit

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT

 contextMenuBehaviour: provide

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE

 contextMenuBehaviour: suppress

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS

contextMenuId

CONTEXT_MENU_ID

STRING