class sap.ui.ux3.ToolPopup

Control sample: sap.ui.ux3.ToolPopup
Visiblity: public
UX Guidelines:
Implements: sap.ui.core.PopupInterface
Available since: N/A
Module: sap/ui/ux3/ToolPopup
Application Component: CA-UI5-CTR

A popup which the user can open from the Shell's tool pane. Generally, the starting point would be an icon. For this pop up, buttons can be defined with any text; therefore, it has the same purpose and similar look like any common dialog box. A ToolPopup can have any content. Depending on the application type and design, the structure of the texts and input fields can be for example form-like.


Constructor

Constructor for a new ToolPopup.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.ux3.ToolPopup(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
autoClose boolean false

Determines whether the ToolPopup will auto close when it loses focus. If the user e.g. clicks outside of the ToolPopup it will be closed. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Since: 1.13.2.

Visibility: public
closeDuration int 400

Time in milliseconds for the close animation.

Since: 1.19.0.

Visibility: public
icon sap.ui.core.URI

This property is relevant for Shell use: The URL to the icon displayed in the tool area which is used to open the ToolPopup. The recommended size is 32x32px, including some transparent border. Therefore, the content will cover about 20x20px.

Visibility: public
iconHover sap.ui.core.URI

This property is relevant for Shell use: The URL to the icon in hover state, displayed in the tool area which is used to open the popup.

Visibility: public
iconSelected sap.ui.core.URI

This property is relevant for Shell use: The URL to the icon in selected state displayed in the tool area which is used to open the popup. If no selected icon is given, the hover icon is used.

Visibility: public
inverted boolean true

Specifies whether the ToolPopup has a dark or bright background. If set to true the background and borders will be dark. If false they will be bright. This property only has an effect for the GoldReflection-theme.

Since: 1.11.1.

Visibility: public
maxHeight sap.ui.core.CSSSize

Forces a maximum height of the ToolPopup in pixels. If the ToolPopup content is higher than the ToolPopup, the content will be scrollable.

Since: 1.13.2.

Visibility: public
maxWidth sap.ui.core.CSSSize

Forces a maximum width of the ToolPopup in pixels.

Since: 1.15.0.

Visibility: public
modal boolean false

Specifies whether the popup is modal and blocks any user-interaction with controls in the background. Changing this property while the ToolPopup is open will not have any effect. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Visibility: public
openDuration int 400

Time in milliseconds for the open animation.

Since: 1.19.0.

Visibility: public
title string

Determines the title displayed in the pop up window

Visibility: public

Aggregations

Default Aggregation: content

Name Cardinality Type Description
buttons 0..n sap.ui.core.Control

Defines the buttons to appear in the popup

content (default) 0..n sap.ui.core.Control

Defines the content of the popup


Associations

Name Cardinality Type Description
defaultButton 0..1 sap.ui.core.Control

Defines one of the buttons that have been provided via button aggregation to be the default button. This default button is initially selected, if no control is set via the initialFocus association explicitly. The default button is activated when Enter is pressed in the context of the dialog and when the currently selected element does not handle the Enter event itself.

Since: 1.20.1.

initialFocus 0..1 sap.ui.core.Control

Defines the control that will get the focus when the ToolPopup is opened.

opener 0..1 sap.ui.core.Control

This property is relevant for stand-alone use: This association needs to be set if the ToolPopup should not be opened by/with the Shell. This association contains the instance of the control that assigns the ToolPopup's position.


Events Overview

Event Description
close

Event is fired when the popup closes because the user pressed Escape or the ToolPopup Button in the Shell. This is called before the closing animation.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

closed

This event is fired after the ToolPopup has finished its closing animation. It is called for EVERY close, regardless of whether the user has triggered the close or whether the ToolPopup was closed via API call.

enter

Event is fired whenever the user clicks the Enter or the Enter key inside the pop up

iconChanged

Event is fired when one of the icon properties is modified (Note: The icon is not rendered by the ToolPopup). To be used by other controls which want to update the icon in their UI.

open

Event is fired when the popup opens

opened

Event is being fired after the ToolPopup has been opened.

Since: 1.19.0.

close

Event is fired when the popup closes because the user pressed Escape or the ToolPopup Button in the Shell. This is called before the closing animation.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

closed

This event is fired after the ToolPopup has finished its closing animation. It is called for EVERY close, regardless of whether the user has triggered the close or whether the ToolPopup was closed via API call.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

enter

Event is fired whenever the user clicks the Enter or the Enter key inside the pop up

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
originalEvent object

The onsapenter event, received by the pop up

originalSrcControl sap.ui.core.Control

The control that was focused when the user pressed the Enter key (may be null)

iconChanged

Event is fired when one of the icon properties is modified (Note: The icon is not rendered by the ToolPopup). To be used by other controls which want to update the icon in their UI.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

open

Event is fired when the popup opens

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

opened

Event is being fired after the ToolPopup has been opened.

Since: 1.19.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addButton

Adds some button to the aggregation buttons.

addContent

Adds some content to the aggregation content.

addFocusableArea

Adds an ID to the Popup that should be focusable as well when using autoclose. Chaining is only possible if a valid type (string) is given.

attachClose

Attaches event handler fnFunction to the close event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when the popup closes because the user pressed Escape or the ToolPopup Button in the Shell. This is called before the closing animation.

attachClosed

Attaches event handler fnFunction to the closed event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

This event is fired after the ToolPopup has finished its closing animation. It is called for EVERY close, regardless of whether the user has triggered the close or whether the ToolPopup was closed via API call.

attachEnter

Attaches event handler fnFunction to the enter event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired whenever the user clicks the Enter or the Enter key inside the pop up

attachIconChanged

Attaches event handler fnFunction to the iconChanged event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when one of the icon properties is modified (Note: The icon is not rendered by the ToolPopup). To be used by other controls which want to update the icon in their UI.

attachOpen

Attaches event handler fnFunction to the open event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when the popup opens

attachOpened

Attaches event handler fnFunction to the opened event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is being fired after the ToolPopup has been opened.

close

Closes the pop up. Can be called by the Shell when the pop up's button is clicked again; or by the application when the interaction in the pop up has been completed or canceled.

destroyButtons

Destroys all the buttons in the aggregation buttons.

destroyContent

Destroys all the content in the aggregation content.

detachClose

Detaches event handler fnFunction from the close event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

detachClosed

Detaches event handler fnFunction from the closed event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

detachEnter

Detaches event handler fnFunction from the enter event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

detachIconChanged

Detaches event handler fnFunction from the iconChanged event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

detachOpen

Detaches event handler fnFunction from the open event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

detachOpened

Detaches event handler fnFunction from the opened event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

sap.ui.ux3.ToolPopup.extend

Creates a new subclass of class sap.ui.ux3.ToolPopup 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.core.Control.extend.

fireClose

Fires event close to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

fireClosed

Fires event closed to attached listeners.

fireEnter

Fires event enter to attached listeners.

fireIconChanged

Fires event iconChanged to attached listeners.

fireOpen

Fires event open to attached listeners.

fireOpened

Fires event opened to attached listeners.

getAutoClose

Gets current value of property autoClose.

Determines whether the ToolPopup will auto close when it loses focus. If the user e.g. clicks outside of the ToolPopup it will be closed. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Default value is false.

getButtons

Gets content of aggregation buttons.

Defines the buttons to appear in the popup

getCloseDuration

Gets current value of property closeDuration.

Time in milliseconds for the close animation.

Default value is 400.

getContent

Gets content of aggregation content.

Defines the content of the popup

getDefaultButton

ID of the element which is the current target of the association defaultButton, or null.

getEnabled

Indicates whether the ToolPopup is currently enabled or not.

Applications can't control the enabled state via a property. A ToolPopup is implicitly enabled depending on its openState. Descendant controls that honor the enabled state of their ancestors will appear disabled after the ToolPopup is closed.

Since 1.13.1. Whether a dialog is regarded as "enabled" during the state transitions (OPENING, CLOSING) is not fully decided. Currently, it is enabled during the OPENING phase and disabled during the CLOSING phase. The only potential change would be to treat the OPENING phase as disabled as well. Applications should be prepared to receive events from "enabled" controls after they called open() on the dialog until close() is called on it. If the mentioned potential change should happen, the dialog will become enabled only after the transition to OPEN. Events from "enabled" children then can still only arrive between open() and close(), so applications that obey the previous rule should continue to work. Only end users or code that explicitly triggers pseudo user events would notice a difference.
A second aspect that might change is the visual behavior of the content: during the CLOSING phase it 'looks' enabled but in fact it is already disabled. This avoids unnecessary redraws for content that becomes hidden soon. Should this show to be confusing for end users, it might be changed.

getIcon

Gets current value of property icon.

This property is relevant for Shell use: The URL to the icon displayed in the tool area which is used to open the ToolPopup. The recommended size is 32x32px, including some transparent border. Therefore, the content will cover about 20x20px.

getIconHover

Gets current value of property iconHover.

This property is relevant for Shell use: The URL to the icon in hover state, displayed in the tool area which is used to open the popup.

getInitialFocus

ID of the element which is the current target of the association initialFocus, or null.

getInverted

Gets current value of property inverted.

Specifies whether the ToolPopup has a dark or bright background. If set to true the background and borders will be dark. If false they will be bright. This property only has an effect for the GoldReflection-theme.

Default value is true.

getMaxHeight

Gets current value of property maxHeight.

Forces a maximum height of the ToolPopup in pixels. If the ToolPopup content is higher than the ToolPopup, the content will be scrollable.

getMaxWidth

Gets current value of property maxWidth.

Forces a maximum width of the ToolPopup in pixels.

sap.ui.ux3.ToolPopup.getMetadata

Returns a metadata object for class sap.ui.ux3.ToolPopup.

getModal

Gets current value of property modal.

Specifies whether the popup is modal and blocks any user-interaction with controls in the background. Changing this property while the ToolPopup is open will not have any effect. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Default value is false.

getOpenDuration

Gets current value of property openDuration.

Time in milliseconds for the open animation.

Default value is 400.

getOpener

ID of the element which is the current target of the association opener, or null.

getTitle

Gets current value of property title.

Determines the title displayed in the pop up window

indexOfButton

Checks for the provided sap.ui.core.Control in the aggregation buttons. and returns its index if found or -1 otherwise.

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

insertButton

Inserts a button into the aggregation buttons.

insertContent

Inserts a content into the aggregation content.

isOpen

Indicates whether the pop up is currently open

open

Opens the ToolPopup. It is checked which control wants to open the ToolPopup. The Shell was previously set as parent so the corresponding parent element is used to set the correct position of the ToolPopup. If another control (i.e. a button) opens the ToolPopup, the control must be previously set as opener via setOpener to the ToolPopup. Corresponding to this opener the position of the ToolPopup will be set. It's also possible to set the position above, below or left from the opener. This can be done via the possible parameters my and at. These parameters refers to work the same way as they do of sap.ui.core.Popup.open.

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeButton

Removes a button from the aggregation buttons.

removeContent

Removes a content from the aggregation content.

removeFocusableArea

Removes an ID to the Popup that should be focusable as well when using autoclose. Chaining is only possible if a valid type (string) is given.

setAutoClose

Sets a new value for property autoClose.

Determines whether the ToolPopup will auto close when it loses focus. If the user e.g. clicks outside of the ToolPopup it will be closed. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setAutoCloseAreas

This is just a forward to the Popup's function (sap.ui.core.Popup.setAutoCloseAreas) with the same functionality.

setCloseDuration

Sets a new value for property closeDuration.

Time in milliseconds for the close animation.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 400.

setDefaultButton

Sets the associated defaultButton.

setInitialFocus

Sets the associated initialFocus.

setInverted

Sets a new value for property inverted.

Specifies whether the ToolPopup has a dark or bright background. If set to true the background and borders will be dark. If false they will be bright. This property only has an effect for the GoldReflection-theme.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setMaxHeight

Sets a new value for property maxHeight.

Forces a maximum height of the ToolPopup in pixels. If the ToolPopup content is higher than the ToolPopup, the content will be scrollable.

When called with a value of null or undefined, the default value of the property will be restored.

setModal

Sets a new value for property modal.

Specifies whether the popup is modal and blocks any user-interaction with controls in the background. Changing this property while the ToolPopup is open will not have any effect. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setOpenDuration

Sets a new value for property openDuration.

Time in milliseconds for the open animation.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 400.

setOpener

Sets the associated opener.

setPosition

Sets the position of the pop up, the same parameters as for sap.ui.core.Popup can be used.

setTitle

Sets a new value for property title.

Determines the title displayed in the pop up window

When called with a value of null or undefined, the default value of the property will be restored.

addButton

Adds some button to the aggregation buttons.

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

The button to add; if empty, nothing is inserted

addContent

Adds some content to the aggregation content.

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

The content to add; if empty, nothing is inserted

addFocusableArea

Adds an ID to the Popup that should be focusable as well when using autoclose. Chaining is only possible if a valid type (string) is given.

Param Type DefaultValue Description
sID string

ID of the corresponding element that should be focusable as well

attachClose

Attaches event handler fnFunction to the close event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when the popup closes because the user pressed Escape or the ToolPopup Button in the Shell. This is called before the closing animation.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

attachClosed

Attaches event handler fnFunction to the closed event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

This event is fired after the ToolPopup has finished its closing animation. It is called for EVERY close, regardless of whether the user has triggered the close or whether the ToolPopup was closed via API call.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

attachEnter

Attaches event handler fnFunction to the enter event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired whenever the user clicks the Enter or the Enter key inside the pop up

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

attachIconChanged

Attaches event handler fnFunction to the iconChanged event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when one of the icon properties is modified (Note: The icon is not rendered by the ToolPopup). To be used by other controls which want to update the icon in their UI.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

attachOpen

Attaches event handler fnFunction to the open event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is fired when the popup opens

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

attachOpened

Attaches event handler fnFunction to the opened event of this sap.ui.ux3.ToolPopup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.ux3.ToolPopup itself.

Event is being fired after the ToolPopup has been opened.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself

close

Closes the pop up. Can be called by the Shell when the pop up's button is clicked again; or by the application when the interaction in the pop up has been completed or canceled.

Param Type DefaultValue Description
bPreventRestoreFocus boolean

If set, the focus is NOT restored to the element that had the focus before the ToolPopup was opened. This makes sense when the ToolPopup is closed programmatically from a different area of the application (outside the ToolPopup) and the focus should not move aways from that place.

destroyButtons

Destroys all the buttons in the aggregation buttons.

destroyContent

Destroys all the content in the aggregation content.

detachClose

Detaches event handler fnFunction from the close event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachClosed

Detaches event handler fnFunction from the closed event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachEnter

Detaches event handler fnFunction from the enter event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachIconChanged

Detaches event handler fnFunction from the iconChanged event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachOpen

Detaches event handler fnFunction from the open event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachOpened

Detaches event handler fnFunction from the opened event of this sap.ui.ux3.ToolPopup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.ux3.ToolPopup.extend

Creates a new subclass of class sap.ui.ux3.ToolPopup 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.core.Control.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

fireClose

Fires event close to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireClosed

Fires event closed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireEnter

Fires event enter to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

originalEvent object

The onsapenter event, received by the pop up

originalSrcControl sap.ui.core.Control

The control that was focused when the user pressed the Enter key (may be null)

fireIconChanged

Fires event iconChanged to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireOpen

Fires event open to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireOpened

Fires event opened to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAutoClose

Gets current value of property autoClose.

Determines whether the ToolPopup will auto close when it loses focus. If the user e.g. clicks outside of the ToolPopup it will be closed. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Default value is false.

getButtons

Gets content of aggregation buttons.

Defines the buttons to appear in the popup

getCloseDuration

Gets current value of property closeDuration.

Time in milliseconds for the close animation.

Default value is 400.

getContent

Gets content of aggregation content.

Defines the content of the popup

getDefaultButton

ID of the element which is the current target of the association defaultButton, or null.

getEnabled

Indicates whether the ToolPopup is currently enabled or not.

Applications can't control the enabled state via a property. A ToolPopup is implicitly enabled depending on its openState. Descendant controls that honor the enabled state of their ancestors will appear disabled after the ToolPopup is closed.

Since 1.13.1. Whether a dialog is regarded as "enabled" during the state transitions (OPENING, CLOSING) is not fully decided. Currently, it is enabled during the OPENING phase and disabled during the CLOSING phase. The only potential change would be to treat the OPENING phase as disabled as well. Applications should be prepared to receive events from "enabled" controls after they called open() on the dialog until close() is called on it. If the mentioned potential change should happen, the dialog will become enabled only after the transition to OPEN. Events from "enabled" children then can still only arrive between open() and close(), so applications that obey the previous rule should continue to work. Only end users or code that explicitly triggers pseudo user events would notice a difference.
A second aspect that might change is the visual behavior of the content: during the CLOSING phase it 'looks' enabled but in fact it is already disabled. This avoids unnecessary redraws for content that becomes hidden soon. Should this show to be confusing for end users, it might be changed.

getIcon

Gets current value of property icon.

This property is relevant for Shell use: The URL to the icon displayed in the tool area which is used to open the ToolPopup. The recommended size is 32x32px, including some transparent border. Therefore, the content will cover about 20x20px.

getIconHover

Gets current value of property iconHover.

This property is relevant for Shell use: The URL to the icon in hover state, displayed in the tool area which is used to open the popup.

getInitialFocus

ID of the element which is the current target of the association initialFocus, or null.

getInverted

Gets current value of property inverted.

Specifies whether the ToolPopup has a dark or bright background. If set to true the background and borders will be dark. If false they will be bright. This property only has an effect for the GoldReflection-theme.

Default value is true.

getMaxHeight

Gets current value of property maxHeight.

Forces a maximum height of the ToolPopup in pixels. If the ToolPopup content is higher than the ToolPopup, the content will be scrollable.

getMaxWidth

Gets current value of property maxWidth.

Forces a maximum width of the ToolPopup in pixels.

sap.ui.ux3.ToolPopup.getMetadata

Returns a metadata object for class sap.ui.ux3.ToolPopup.

getModal

Gets current value of property modal.

Specifies whether the popup is modal and blocks any user-interaction with controls in the background. Changing this property while the ToolPopup is open will not have any effect. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

Default value is false.

getOpenDuration

Gets current value of property openDuration.

Time in milliseconds for the open animation.

Default value is 400.

getOpener

ID of the element which is the current target of the association opener, or null.

getTitle

Gets current value of property title.

Determines the title displayed in the pop up window

indexOfButton

Checks for the provided sap.ui.core.Control in the aggregation buttons. and returns its index if found or -1 otherwise.

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

The button whose index is looked for

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

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

The content whose index is looked for

insertButton

Inserts a button into the aggregation buttons.

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

The button to insert; if empty, nothing is inserted

iIndex int

The 0-based index the button should be inserted at; for a negative value of iIndex, the button is inserted at position 0; for a value greater than the current size of the aggregation, the button is inserted at the last position

insertContent

Inserts a content into the aggregation content.

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

The content to insert; if empty, nothing is inserted

iIndex int

The 0-based index the content should be inserted at; for a negative value of iIndex, the content is inserted at position 0; for a value greater than the current size of the aggregation, the content is inserted at the last position

isOpen

Indicates whether the pop up is currently open

open

Opens the ToolPopup. It is checked which control wants to open the ToolPopup. The Shell was previously set as parent so the corresponding parent element is used to set the correct position of the ToolPopup. If another control (i.e. a button) opens the ToolPopup, the control must be previously set as opener via setOpener to the ToolPopup. Corresponding to this opener the position of the ToolPopup will be set. It's also possible to set the position above, below or left from the opener. This can be done via the possible parameters my and at. These parameters refers to work the same way as they do of sap.ui.core.Popup.open.

Param Type DefaultValue Description
my sap.ui.core.Popup.Dock sap.ui.core.Popup.Dock.CenterCenter

The ToolPopup's content reference position for docking

at sap.ui.core.Popup.Dock sap.ui.core.Popup.Dock.CenterCenter

The "of" element's reference point for docking to

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeButton

Removes a button from the aggregation buttons.

Param Type DefaultValue Description
vButton int string sap.ui.core.Control

The button to remove or its index or id

removeContent

Removes a content from the aggregation content.

Param Type DefaultValue Description
vContent int string sap.ui.core.Control

The content to remove or its index or id

removeFocusableArea

Removes an ID to the Popup that should be focusable as well when using autoclose. Chaining is only possible if a valid type (string) is given.

Param Type DefaultValue Description
sID string

ID of the corresponding element

setAutoClose

Sets a new value for property autoClose.

Determines whether the ToolPopup will auto close when it loses focus. If the user e.g. clicks outside of the ToolPopup it will be closed. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bAutoClose boolean false

New value for property autoClose

setAutoCloseAreas

This is just a forward to the Popup's function (sap.ui.core.Popup.setAutoCloseAreas) with the same functionality.

Param Type DefaultValue Description
aAutoCloseAreas Element[]

setCloseDuration

Sets a new value for property closeDuration.

Time in milliseconds for the close animation.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 400.

Param Type DefaultValue Description
iCloseDuration int 400

New value for property closeDuration

setDefaultButton

Sets the associated defaultButton.

Param Type DefaultValue Description
oDefaultButton sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this defaultButton association; alternatively, an element instance may be given

setInitialFocus

Sets the associated initialFocus.

Param Type DefaultValue Description
oInitialFocus sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this initialFocus association; alternatively, an element instance may be given

setInverted

Sets a new value for property inverted.

Specifies whether the ToolPopup has a dark or bright background. If set to true the background and borders will be dark. If false they will be bright. This property only has an effect for the GoldReflection-theme.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bInverted boolean true

New value for property inverted

setMaxHeight

Sets a new value for property maxHeight.

Forces a maximum height of the ToolPopup in pixels. If the ToolPopup content is higher than the ToolPopup, the content will be scrollable.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sMaxHeight sap.ui.core.CSSSize

New value for property maxHeight

setModal

Sets a new value for property modal.

Specifies whether the popup is modal and blocks any user-interaction with controls in the background. Changing this property while the ToolPopup is open will not have any effect. Please don't use "modal" and "autoclose" at the same time. In this case a warning will be prompted to the console and "autoclose" won't be used.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bModal boolean false

New value for property modal

setOpenDuration

Sets a new value for property openDuration.

Time in milliseconds for the open animation.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 400.

Param Type DefaultValue Description
iOpenDuration int 400

New value for property openDuration

setOpener

Sets the associated opener.

Param Type DefaultValue Description
oOpener sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this opener association; alternatively, an element instance may be given

setPosition

Sets the position of the pop up, the same parameters as for sap.ui.core.Popup can be used.

setTitle

Sets a new value for property title.

Determines the title displayed in the pop up window

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sTitle string

New value for property title