class sap.m.routing.TargetHandler

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/routing/TargetHandler
Application Component: CA-UI5-CTR

Used for closing dialogs and showing transitions in NavContainers when targets are displayed.

Note: You should not create an own instance of this class. It is created when using sap.m.routing.Router or sap.m.routing.Targets.

Note: You may use the #setCloseDialogs function to specify if dialogs should be closed on displaying other views. The dialogs are closed when a different target is displayed than the previously displayed one, otherwise the dialogs are kept open.


Constructor

Constructor for a new TargetHandler.

new sap.m.routing.TargetHandler(closeDialogs)
Param Type Default Value Description
closeDialogs boolean

Closes all open dialogs before navigating to a different target, if set to true (default). If set to false, it will just navigate without closing dialogs.


Methods Overview

Method Description
sap.m.routing.TargetHandler.extend

Creates a new subclass of class sap.m.routing.TargetHandler with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

getCloseDialogs

Gets if a navigation should close dialogs.

sap.m.routing.TargetHandler.getMetadata

Returns a metadata object for class sap.m.routing.TargetHandler.

setCloseDialogs

Sets if a navigation should close dialogs.

Note: The dialogs are closed when a different target is displayed than the previous one, otherwise the dialogs are kept open even when bCloseDialogs is true.

showPlaceholder

Calls the 'showPlaceholder' method of the respective target container control depending on whether a placeholder is needed or not.

sap.m.routing.TargetHandler.extend

Creates a new subclass of class sap.m.routing.TargetHandler with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getCloseDialogs

Gets if a navigation should close dialogs.

sap.m.routing.TargetHandler.getMetadata

Returns a metadata object for class sap.m.routing.TargetHandler.

setCloseDialogs

Sets if a navigation should close dialogs.

Note: The dialogs are closed when a different target is displayed than the previous one, otherwise the dialogs are kept open even when bCloseDialogs is true.

Param Type DefaultValue Description
bCloseDialogs boolean

Close dialogs if true

showPlaceholder

Calls the 'showPlaceholder' method of the respective target container control depending on whether a placeholder is needed or not.

Param Type DefaultValue Description
mSettings object

Object containing the container control and the view object to display

container sap.ui.core.Control

The navigation target container

object sap.ui.core.Control Promise

The component/view object