
Using Static Dropdown Menus
Purpose
Pushbuttons in the SAP Toolbar that have a dropdown menu (type
cntb_btype_dropdown or cntb_btype_menu ) normally trigger the event DROPDOWN_CLICKED when the user chooses them. In this event, you assign a context menu to the button, which the system then displays as a dropdown menu to the button. This happens every time the user chooses the button, even if the menu does not change from one time to the next.To avoid this situation, which can be particularly inefficient in the SAPGUI for HTML environment, it is now possible to assign a context menu statically to a button with a dropdown menu. When you do this, the context menu remains assigned to the pushbutton for the entire lifetime of the toolbar, and the
DROPDOWN_CLICKED event is no longer triggered, which reduces the number of round trips required.Should you change the contents of the context menu after assigning it to a button in the toolbar, the system ensures that the dropdown menu in the toolbar is updated accordingly.
Prerequisites
You must already have created an instance of the SAP Toolbar. It must contain one or more buttons with the type
cntb_btype_dropdown or cntb_btype_menu .Process Flow
Context Menus.
Example
For an example, refer to the Creating and Filling the Dropdown Menus section of the
coding example.