namespace sap.m.InstanceManager

Control sample: sap.m.InstanceManager
Visiblity: public
Available since: N/A
Module: sap/m/InstanceManager
Application Component: CA-UI5-CTR

Provides methods to manage instances. This is specifically designed for managing the opened Popover, Dialog, ActionSheet, and it's possible to close all of the opened Popover, Dialog, ActionSheet in history handling.

Example:

  sap.ui.define([
     "sap/m/InstanceManager"
  ], function(InstanceManager) {
    ...
    InstanceManager.closeAllPopovers();
    ...
  });


Nodes Overview

Node Description

Methods Overview

Method Description
sap.m.InstanceManager.addDialogInstance

Adds a control to predefined dialog category in instance manager.

sap.m.InstanceManager.addInstance

Adds an instance to the given category. If the instance is already added to the same category, it won't be added again.

sap.m.InstanceManager.addLightBoxInstance

Adds a control to predefined lightbox category in instance manager.

sap.m.InstanceManager.addPopoverInstance

Adds a control to predefined popover category in instance manager.

sap.m.InstanceManager.closeAllDialogs

Closes all of the open dialogs.

sap.m.InstanceManager.closeAllLightBoxes

Closes all open lightboxes.

sap.m.InstanceManager.closeAllPopovers

Closes all open popovers.

sap.m.InstanceManager.getInstancesByCategoryId

Returns an array of managed instances in the given category.

sap.m.InstanceManager.getOpenDialogs

Gets all of the open dialogs. If there's no dialog open, an empty array is returned.

sap.m.InstanceManager.getOpenLightBoxes

Gets all of the open LightBoxes. If there's no dialog open, an empty array is returned.

sap.m.InstanceManager.getOpenPopovers

Gets all of the open popovers. If there's no popover open, an empty array is returned.

sap.m.InstanceManager.hasOpenDialog

Returns true if there's at least one dialog managed in the predefined dialog category, otherwise it returns false.

sap.m.InstanceManager.hasOpenLightBox

Returns true if there's at least one LightBox managed in the predefined lightbox category, otherwise it returns false.

sap.m.InstanceManager.hasOpenPopover

Returns true if there's at least one popover managed in the predefined popover category, otherwise it returns false.

sap.m.InstanceManager.isCategoryEmpty

Returns if there's no managed instance in the given category.

sap.m.InstanceManager.isDialogOpen

Checks if the given dialog instance is managed under the dialog category. For dialog instances, managed means the dialog is open.

This function is specially provided for customized controls which doesn't have the possibility to check whether it's open. If the given dialog is an instance of sap.m.Dialog, sap.m.ActionSheet, the isOpen() method on the instance is preferred to be called than this function.

sap.m.InstanceManager.isInstanceManaged

Checks if an instance is managed under the given category.

sap.m.InstanceManager.isLightBoxOpen

Check if the given LightBox instance is managed under the LightBox category. For LightBox instances, 'managed' means the LightBox is open.

This function is specially intended for controls that don't provide a way to check whether they're open. If the given lightbox is an instance of sap.m.LightBox, its isOpen() should be called instead of this function.

sap.m.InstanceManager.isPopoverOpen

Check if the given popover instance is managed under the popover category. For popover instances, managed means the popover is open.

This function is specially provided for customized controls which doesn't have the possibility to check whether it's open. If the given popover is an instance of sap.m.Popover, sap.m.ActionSheet, the isOpen() method on the instance is preferred to be called than this function.

sap.m.InstanceManager.removeDialogInstance

Removes control from predefined dialog category in instance manager.

sap.m.InstanceManager.removeInstance

Removes a managed instance from the given category.

sap.m.InstanceManager.removeLightBoxInstance

Removes control from predefined lightbox category in instance manager.

sap.m.InstanceManager.removePopoverInstance

Removes control from predefined popover category in instance manager.

sap.m.InstanceManager.addDialogInstance

Adds a control to predefined dialog category in instance manager.

Param Type DefaultValue Description
oDialog sap.ui.core.Control

Dialog to be added to instance manager. Dialog which doesn't inherit from sap.m.Dialog can also be added as long as it has a close method.

sap.m.InstanceManager.addInstance

Adds an instance to the given category. If the instance is already added to the same category, it won't be added again.

Param Type DefaultValue Description
sCategoryId string

The category's id.

oInstance object

The instance that will be added to the given category.

sap.m.InstanceManager.addLightBoxInstance

Adds a control to predefined lightbox category in instance manager.

Param Type DefaultValue Description
oLightBox sap.m.LightBox

Dialog to be added to instance manager. Dialog which doesn't inherit from sap.m.Dialog can also be added as long as it has a close method.

sap.m.InstanceManager.addPopoverInstance

Adds a control to predefined popover category in instance manager.

Param Type DefaultValue Description
oPopover sap.ui.core.Control

Popover to be added to instance manager. Custom popover which doesn't inherit from sap.m.Popover can also be added as long as it has a close method.

sap.m.InstanceManager.closeAllDialogs

Closes all of the open dialogs.

Param Type DefaultValue Description
fnCallback function

sap.m.InstanceManager.closeAllLightBoxes

Closes all open lightboxes.

Param Type DefaultValue Description

sap.m.InstanceManager.closeAllPopovers

Closes all open popovers.

Param Type DefaultValue Description

sap.m.InstanceManager.getInstancesByCategoryId

Returns an array of managed instances in the given category.

Param Type DefaultValue Description
sCategoryId string

The category's id.

sap.m.InstanceManager.getOpenDialogs

Gets all of the open dialogs. If there's no dialog open, an empty array is returned.

Param Type DefaultValue Description

sap.m.InstanceManager.getOpenLightBoxes

Gets all of the open LightBoxes. If there's no dialog open, an empty array is returned.

Param Type DefaultValue Description

sap.m.InstanceManager.getOpenPopovers

Gets all of the open popovers. If there's no popover open, an empty array is returned.

Param Type DefaultValue Description

sap.m.InstanceManager.hasOpenDialog

Returns true if there's at least one dialog managed in the predefined dialog category, otherwise it returns false.

Param Type DefaultValue Description

sap.m.InstanceManager.hasOpenLightBox

Returns true if there's at least one LightBox managed in the predefined lightbox category, otherwise it returns false.

Param Type DefaultValue Description

sap.m.InstanceManager.hasOpenPopover

Returns true if there's at least one popover managed in the predefined popover category, otherwise it returns false.

Param Type DefaultValue Description

sap.m.InstanceManager.isCategoryEmpty

Returns if there's no managed instance in the given category.

Param Type DefaultValue Description
sCategoryId string

The category's id.

sap.m.InstanceManager.isDialogOpen

Checks if the given dialog instance is managed under the dialog category. For dialog instances, managed means the dialog is open.

This function is specially provided for customized controls which doesn't have the possibility to check whether it's open. If the given dialog is an instance of sap.m.Dialog, sap.m.ActionSheet, the isOpen() method on the instance is preferred to be called than this function.

Param Type DefaultValue Description
oDialog sap.ui.core.Control

The dialog that is checked for the openness.

sap.m.InstanceManager.isInstanceManaged

Checks if an instance is managed under the given category.

Param Type DefaultValue Description
sCategoryId string

The category that the instance is supposed to be in.

oInstance object

The instance that needs to be checked.

sap.m.InstanceManager.isLightBoxOpen

Check if the given LightBox instance is managed under the LightBox category. For LightBox instances, 'managed' means the LightBox is open.

This function is specially intended for controls that don't provide a way to check whether they're open. If the given lightbox is an instance of sap.m.LightBox, its isOpen() should be called instead of this function.

Param Type DefaultValue Description
oLightBox sap.m.LightBox

The LightBox that is checked.

sap.m.InstanceManager.isPopoverOpen

Check if the given popover instance is managed under the popover category. For popover instances, managed means the popover is open.

This function is specially provided for customized controls which doesn't have the possibility to check whether it's open. If the given popover is an instance of sap.m.Popover, sap.m.ActionSheet, the isOpen() method on the instance is preferred to be called than this function.

Param Type DefaultValue Description
oPopover sap.ui.core.Control

The popover that is checked for the openness.

sap.m.InstanceManager.removeDialogInstance

Removes control from predefined dialog category in instance manager.

Param Type DefaultValue Description
oDialog sap.ui.core.Control

to be removed from instance manager.

sap.m.InstanceManager.removeInstance

Removes a managed instance from the given category.

Param Type DefaultValue Description
sCategoryId string

The category's id.

oInstance object

The instance that will be removed from the given category.

sap.m.InstanceManager.removeLightBoxInstance

Removes control from predefined lightbox category in instance manager.

Param Type DefaultValue Description
oLightBox sap.m.LightBox

to be removed from instance manager.

sap.m.InstanceManager.removePopoverInstance

Removes control from predefined popover category in instance manager.

Param Type DefaultValue Description
oPopover sap.ui.core.Control

to be removed from instance manager.