Show TOC

Adding a Sub HeaderLocate this document in the navigation structure

Methods of the Renderer API that adds an area under the shell header area that can be used as a message area or for adding additional buttons to the header.

Syntax

addSubHeader(controlType, oControlProperties, bIsVisible, bCurrentState, aStates)

This method is part of the SAPUI5 sap.ushell.renderers.fiori2.renderer namespace. For more information, see SAPUI5 Demo Kit: Controls Start of the navigation path API REFERENCE Next navigation step sap.ushell.renderers.fiori2 Next navigation step Renderer End of the navigation path.

Parameters
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 sub header control 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.

To determine when the item is displayed, the launchpad state parameters can have the following values of the sap.ushell.renderers.fiori2.Renderer.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
Sample Code
<SCRIPT language ="JavaScript">

var oRenderer = sap.ushell.Container.getRenderer("fiori2");
oRenderer.addSubHeader("sap.m.Bar", {id: "testBar"}, true, true);
   
<SCRIPT>