Methods of the Renderer API that add an item to, or remove the added item from, the Options menu.
addActionButton(controlType, oControlProperties, bIsVisible, bCurrentState, aStates)
hideActionButton(controlType, oControlProperties, bIsVisible, bCurrentState, aStates)
These methods are part of the SAPUI5 sap.ushell.renderers.fiori2 namespace. For more information, see SAPUI5 Demo Kit: Controls .
Parameter | Type | Description |
---|---|---|
controlType | String | The class name of the control type to create. |
oControlProperties | Object | The properties that will be passed to the created control. |
bIsVisible | Boolean |
Specifies whether the item is displayed after being created. If true, The control is displayed according to the bCurrentState and aStates parameters. If false, the control is created but not displayed. |
bCurrentState | Boolean | If true, the created control is added to the current rendered shell
state. When the user navigates to a different state, or to a
different application, then the control is removed. If false, the control is added to the LaunchpadState. |
aStates |
String |
Valid only if bCurrentState is set to false A list of the launchpad states in which to add the control. |
<SCRIPT language ="JavaScript"> ... var oRenderer = sap.ushell.Container.getRenderer("fiori2"); oRenderer.addActionButton( "sap.ushell.ui.custom.myBtton", => the type of the object to add in this case a custom button { id: "hideGroupsBtn" => Property of the object instance to add, the instance is created with this properties object }, true, => isVIsible true); => added to the current state and removed when navigation away form it ... <SCRIPT>
You can only remove buttons that were added to the action sheet by the addActionButton method.