Show TOC

Adding and Removing Custom Items to the Options MenuLocate this document in the navigation structure

Methods of the RendererExtensions API that add an item to, or remove the added item from, the Options menu.

Syntax

addOptionsActionSheetButton(oButton[, sLaunchpadState1],[sLaunchpadState2],[sLaunchpadState3])

removeOptionsActionSheetButton(oButton[, sLaunchpadState1],[sLaunchpadState2],[sLaunchpadState3])

These methods are part of the SAPUI5 sap.ushell.renderers.fiori2 namespace. For more information, see SAPUI5 Demo Kit: Controls Start of the navigation path API REFERENCE Next navigation step sap.ushell Next navigation step services Next navigation step renderers End of the navigation path.

Parameters
Parameter Type Description
oButton Object The button to be added. The button should have an icon, text, tooltip, and a press callback.
sLaunchpadState1 String Optional. A launchpad state in which to add the button.
sLaunchpadState2 String Optional. A launchpad state in which to add the button.
sLaunchpadState3 String Optional. A launchpad state in which to add the button.
To determine when the button is displayed, the launchpad state parameters can have the following values of the sap.ushell.renderers.fiori2.RendererExtensions.LaunchpadState enum:
  • Launchpadstate.App: The launchpad state when running a Fiori app.
  • Launchpadstate.Catalog: The launchpad state when the tile catalog is open.
  • Launchpadstate.Home: The launchpad state when the home page is open.
If no launchpad state is passed the button is added in all states.
Example
<SCRIPT language ="JavaScript">
   ...
var button1 = new sap.m.Button();
var rendererExt = sap.ushell.renderers.fiori2.RendererExtensions;
rendererExt.addOptionsActionSheetButton(button1,rendererExt.LaunchpadState.Home,rendererExt.LaunchpadState.Catalog,rendererExt.LaunchpadState.App);
rendererExt.removeOptionsActionSheetButton(button1,rendererExt.LaunchpadState.Home,rendererExt.LaunchpadState.Catalog,rendererExt.LaunchpadState.App);
   ...
<SCRIPT>
Note

You can only remove buttons that were added to the action sheet by the addOptionsActionSheetButton method.