sap.ui.ux3.ToolPopup.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.ux3.ToolPopup.
Returns:
Adds some button to the aggregation buttons
.
Parameters:
Returns:
Adds some content to the aggregation content
.
Parameters:
Returns:
addFocusableArea(sID?)
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.
Parameters:
{string} | sID? | ID of the corresponding element that should be focusable as well |
- Since:
- 1.19.0
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
Returns:
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
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
Returns:
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
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.ux3.ToolPopup itself |
- Since:
- 1.19.0
Returns:
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.
Parameters:
{boolean} | bPreventRestoreFocus | 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. |
Returns:
Destroys all the buttons in the aggregation buttons
.
Returns:
Destroys all the content in the aggregation content
.
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
- Since:
- 1.19.0
Returns:
fireClose(mArguments?): boolean
Fires event
close
to attached listeners.
Listeners may prevent the default action of this event by using the preventDefault
-method on the event object.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{boolean} | Whether or not to prevent the default action |
Fires event closed
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event
enter
to attached listeners.
Expects the following event parameters:
originalEvent
of type object
The onsapenter event, received by the pop uporiginalSrcControl
of type sap.ui.core.Control
The control that was focused when the user pressed the Enter key (may be null)
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event iconChanged
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event open
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event opened
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
- Since:
- 1.19.0
Returns:
getAutoClose(): boolean
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
.
- Since:
- 1.13.2
Returns:
{boolean} | Value of property autoClose |
Gets content of aggregation
buttons
.
Defines the buttons to appear in the popup
Returns:
getCloseDuration(): int
Gets current value of property
closeDuration
.
Time in milliseconds for the close animation.
Default value is 400
.
- Since:
- 1.19.0
Returns:
{int} | Value of property closeDuration |
Gets content of aggregation
content
.
Defines the content of the popup
Returns:
ID of the element which is the current target of the association defaultButton
, or null
.
- Since:
- 1.20.1
Returns:
getEnabled(): boolean
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.
- Since:
- 1.13.1
Returns:
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.
Returns:
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.
Returns:
ID of the element which is the current target of the association initialFocus
, or null
.
Returns:
getInverted(): boolean
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
.
- Since:
- 1.11.1
Returns:
{boolean} | Value of property inverted |
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.
- Since:
- 1.13.2
Returns:
Gets current value of property
maxWidth
.
Forces a maximum width of the ToolPopup in pixels.
- Since:
- 1.15.0
Returns:
getModal(): boolean
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
.
Returns:
{boolean} | Value of property modal |
getOpenDuration(): int
Gets current value of property
openDuration
.
Time in milliseconds for the open animation.
Default value is 400
.
- Since:
- 1.19.0
Returns:
{int} | Value of property openDuration |
ID of the element which is the current target of the association opener
, or null
.
Returns:
getTitle(): string
Gets current value of property
title
.
Determines the title displayed in the pop up window
Returns:
{string} | Value of property title |
indexOfButton(oButton): int
Checks for the provided sap.ui.core.Control
in the aggregation buttons
. and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
indexOfContent(oContent): int
Checks for the provided sap.ui.core.Control
in the aggregation content
. and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a button into the aggregation buttons
.
Parameters:
{sap.ui.core.Control} | oButton | the button to insert; if empty, nothing is inserted |
{int} | iIndex | 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 |
Returns:
Inserts a content into the aggregation content
.
Parameters:
{sap.ui.core.Control} | oContent | the content to insert; if empty, nothing is inserted |
{int} | iIndex | 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 |
Returns:
isOpen(): boolean
Indicates whether the pop up is currently open
Returns:
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.
Parameters:
{sap.ui.core.Popup.Dock} | my?, Default: sap.ui.core.Popup.Dock.CenterCenter | The ToolPopup's content reference position for docking |
{sap.ui.core.Popup.Dock} | at?, Default: sap.ui.core.Popup.Dock.CenterCenter | The "of" element's reference point for docking to |
Returns:
Removes all the controls from the aggregation
buttons
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes all the controls from the aggregation
content
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a button from the aggregation buttons
.
Parameters:
Returns:
Removes a content from the aggregation content
.
Parameters:
Returns:
removeFocusableArea(sID?)
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.
Parameters:
{string} | sID? | ID of the corresponding element |
- Since:
- 1.19.0
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
.
Parameters:
{boolean} | bAutoClose | New value for property autoClose |
- Since:
- 1.13.2
Returns:
setAutoCloseAreas(aAutoCloseAreas)
This is just a forward to the Popup's function (sap.ui.core.Popup.setAutoCloseAreas) with the same functionality.
Parameters:
{Element[]} | aAutoCloseAreas | |
- Since:
- 1.19.0
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
.
Parameters:
{int} | iCloseDuration | New value for property closeDuration |
- Since:
- 1.19.0
Returns:
Sets the associated defaultButton
.
Parameters:
{sap.ui.core.Control} | oDefaultButton | Id of an element which becomes the new target of this defaultButton association; alternatively, an element instance may be given |
- Since:
- 1.20.1
Returns:
Sets the associated initialFocus
.
Parameters:
{sap.ui.core.Control} | oInitialFocus | Id of an element which becomes the new target of this initialFocus association; alternatively, an element instance may be given |
Returns:
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
.
Parameters:
{boolean} | bInverted | New value for property inverted |
- Since:
- 1.11.1
Returns:
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.
Parameters:
- Since:
- 1.13.2
Returns:
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
.
Parameters:
{boolean} | bModal | New value for property modal |
Returns:
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
.
Parameters:
{int} | iOpenDuration | New value for property openDuration |
- Since:
- 1.19.0
Returns:
Sets the associated opener
.
Parameters:
{sap.ui.core.Control} | oOpener | Id of an element which becomes the new target of this opener association; alternatively, an element instance may be given |
Returns:
setPosition()
Sets the position of the pop up, the same parameters as for sap.ui.core.Popup can be used.
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.
Parameters:
{string} | sTitle | New value for property title |
Returns: