sap.ui.core.Popup.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Popup 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.ManagedObject.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 |
sap.ui.core.Popup.getLastZIndex(): Number
Returns the last z-index that has been handed out. does not increase the internal z-index counter.
Returns:
Returns a metadata object for class sap.ui.core.Popup.
Returns:
sap.ui.core.Popup.getNextZIndex(): Number
Returns the next available z-index on top of the existing/previous popups. Each call increases the internal z-index counter and the returned z-index.
Returns:
{Number} | the next z-index on top of the Popup stack |
sap.ui.core.Popup.setInitialZIndex(iInitialZIndex)
Set an initial z-index that should be used by all Popup so all Popups start at least with the set z-index. If the given z-index is lower than any current available z-index the highest z-index will be used.
Parameters:
{Number} | iInitialZIndex | is the initial z-index |
- Since:
- 1.30.0
Attaches event handler
fnFunction
to the
closed
event of this
sap.ui.core.Popup
.
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.core.Popup
itself.
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.core.Popup itself |
Returns:
Attaches event handler
fnFunction
to the
opened
event of this
sap.ui.core.Popup
.
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.core.Popup
itself.
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.core.Popup itself |
Returns:
close(iDuration?)
Closes the popup.
If the Popup is already closed or in the process of closing, calling this method does nothing. If the Popup is in the process of being opened and closed with a duration of 0, calling this method does nothing. If the Popup is in the process of being opened and closed with an animation duration, the animation will be chained, but this functionality is dangerous, may lead to inconsistent behavior and is thus not recommended and may even be removed.
Parameters:
{int} | iDuration? | animation duration in milliseconds; default is the jQuery preset "fast". For iDuration == 0 the closing happens synchronously without animation. |
destroy()
Closes and destroys this instance of Popup. Does not destroy the hosted content.
Detaches event handler
fnFunction
from the
closed
event of this
sap.ui.core.Popup
.
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.core.Popup
.
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:
exit()
When the Popup is being destroyed all corresponding references should be deleted as well to prevent any memory leaks.
Fires event closed
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 |
Returns:
getAutoClose(): boolean
Determines whether the pop-up should auto closes or not.
- Since:
- 1.16
Returns:
Returns this Popup's content.
Returns:
getFollowOf(): boolean|function
This returns true/false if the default followOf method should be used. If a separate followOf-handler was previously added the correspodning function is returned.
- Since:
- 1.13.0
Returns:
{boolean|function} | if a function was set it is returned otherwise a boolean value whether the follow of is activated |
getLastZIndex(): Number
Returns the last z-index that has been handed out. does not increase the internal z-index counter.
Returns:
getModal()
Returns the value if a Popup is of modal type
getNextZIndex(): Number
Returns the next available z-index on top of the existing/previous popups. Each call increases the internal z-index counter and the returned z-index.
Returns:
{Number} | the next z-index on top of the Popup stack |
Returns whether the Popup is currently open, closed, or transitioning between these states.
Returns:
isOpen(): boolean
Returns whether the Popup is currently open (this includes opening and closing animations).
Returns:
{boolean} | whether the Popup is opened (or currently being opened or closed) |
open(iDuration?, my?, at?, of?, offset?, collision?, followOf?)
Opens the popup's content at the position either specified here or beforehand via
setPosition. Content must be capable of being positioned via "position:absolute;" All parameters are optional (open() may be called without any parameters). iDuration may just be omitted, but if any of "at", "of", "offset", "collision" is given, also the preceding positioning parameters ("my", at",...) must be given.
If the Popup's OpenState is different from "CLOSED" (i.e. if the Popup is already open, opening or closing), the call is ignored.
Parameters:
{int} | iDuration? | animation duration in milliseconds; default is the jQuery preset "fast". For iDuration == 0 the opening happens synchronously without animation. |
{sap.ui.core.Popup.Dock} | my?, Default: sap.ui.core.Popup.Dock.CenterCenter | the popup content's 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 |
{string|sap.ui.core.Element|DOMRef|jQuery|jQuery.Event} | of?, Default: document | specifies the reference element to which the given content should dock to |
{string} | offset?, Default: '0 0' | the offset relative to the docking point, specified as a string with space-separated pixel values (e.g. "0 10" to move the popup 10 pixels to the right). If the docking of both "my" and "at" are both RTL-sensitive ("begin" or "end"), this offset is automatically mirrored in the RTL case as well. |
{string} | collision?, Default: 'flip' | defines how the position of an element should be adjusted in case it overflows the window in some direction. |
{boolean} | followOf? | defines whether the popup should follow the dock reference when the reference changes its position. |
Sets the animation functions to use for opening and closing the Popup. Any null value will be ignored and not change the respective animation function. When called, the animation functions receive three parameters: - the jQuery object wrapping the DomRef of the popup - the requested animation duration - a function that MUST be called once the animation has completed
Parameters:
{function} | fnOpen | |
{function} | fnClose | |
Returns:
Used to specify whether the Popup should close as soon as - for non-touch environment: the focus leaves - for touch environment: user clicks the area which is outside the popup itself, the dom elemnt which popup aligns to (except document), and one of the autoCloseAreas set by calling setAutoCloseAreas.
Parameters:
{boolean} | bAutoClose | whether the Popup should close as soon as the focus leaves |
Returns:
Sets the additional areas in the page that are considered part of the Popup when autoclose is enabled. - non-touch environment: if the focus leaves the Popup but immediately enters one of these areas, the Popup does NOT close. - touch environment: if user clicks one of these areas, the Popup does NOT close.
Parameters:
{DomRef[]} | aAutoCloseAreas | an array containing DOM elements considered part of the Popup; a value of null removes all previous areas |
Returns:
Sets the content this instance of the Popup should render. Content must be capable of being positioned via position:absolute;
Parameters:
Returns:
Sets the durations for opening and closing animations. Null values and values < 0 are ignored. A duration of 0 means no animation. Default value is "fast" which is the jQuery constant for "200 ms".
Parameters:
{int} | iOpenDuration | in milliseconds |
{int} | iCloseDuration | in milliseconds |
Returns:
setFollowOf(followOf)
This enabled/disables the Popup to follow its opening reference. If the Popup is open and a followOf should be set the corresponding listener will be attached.
Parameters:
{boolean|function|null} | followOf | a boolean value enabled/disables the default followOf-Handler. Or an individual handler can be given. null deletes all followOf settings. |
- Since:
- 1.13.0
setInitialFocusId(sId)
Sets the ID of the element that should be focused once the popup opens. If the given ID is the ID of an existing Control, this Control's focusDomRef will be focused instead, which may be an HTML element with a different ID (usually a sub-element inside the Control). If no existing element ID is supplied and the Popup is modal or auto-close, the Popup will instead focus the first focusable element.
Parameters:
{string} | sId | the ID of the DOM element to focus |
Used to specify whether the Popup should be modal. A modal popup will put some fading "block layer" over the background and prevent attempts to put the focus outside/below the popup. Setting this while the popup is open will change "block layer" immediately.
Parameters:
{boolean} | bModal | whether the Popup is of modal type |
{string} | sModalCSSClass? | a CSS class (or space-separated list of classes) that should be added to the block layer |
Returns:
Sets the position of the Popup (if you refer to a Control as anchor then do not use the DOMRef of the control which might change after re-renderings). Optional parameters can only be omitted when all subsequent parameters are omitted as well.
Parameters:
{sap.ui.core.Popup.Dock} | my | specifies which point of the given Content should be aligned |
{sap.ui.core.Popup.Dock|Object} | at | specifies the point of the reference element to which the given Content should be aligned |
{string|sap.ui.core.Element|DOMRef|jQuery|jQuery.Event} | of?, Default: document | specifies the reference element to which the given content should be aligned as specified in the other parameters |
{string} | offset?, Default: '0 0' | the offset relative to the docking point, specified as a string with space-separated pixel values (e.g. "0 10" to move the popup 10 pixels to the right). If the docking of both "my" and "at" are both RTL-sensitive ("begin" or "end"), this offset is automatically mirrored in the RTL case as well. |
{string} | collision? | defines how the position of an element should be adjusted in case it overflows the window in some direction. The valid values that refer to jQuery-UI's position parameters are "flip", "fit" and "none". |
Returns:
Determines whether the Popup should have a shadow (in supporting browsers). This also affects a currently open popup.
Parameters:
{boolean} | bShowShadow | whether to show a shadow |
Returns: