sap.m.Popover.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Popover 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.m.Popover.
Returns:
sap.m.Popover.outerHeight(oElement, bIncludeMargin)
Calculate outerHeight of the element; used as hook for SVG elements
Parameters:
{HTMLElement} | oElement | An Element for which outerHeight will be calculated. |
{boolean} | bIncludeMargin | Determines if the margins should be included in the calculated outerHeight. Default value is false. |
sap.m.Popover.outerWidth(oElement, bIncludeMargin)
Calculate outerWidth of the element; used as hook for SVG elements
Parameters:
{HTMLElement} | oElement | An Element for which outerWidth will be calculated. |
{boolean} | bIncludeMargin | Determines if the margins should be included in the calculated outerWidth. Default value is false. |
_afterAdjustPositionAndArrowHook()
Hook called after adjusment of the Popover position.
_getAnyHeader()
If customHeader is set, this will return the customHeaer. Otherwise it creates a header and put the title and buttons if needed inside, and finally return this newly create header.
Adds some ariaDescribedBy into the association ariaDescribedBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaDescribedBy | the ariaDescribedBy to add; if empty, nothing is inserted |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Adds some content to the aggregation content
.
Parameters:
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Attaches event handler
fnFunction
to the
afterClose
event of this
sap.m.Popover
.
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.m.Popover
itself.
This event will be fired after the popover is closed.
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.m.Popover itself |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Attaches event handler
fnFunction
to the
afterOpen
event of this
sap.m.Popover
.
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.m.Popover
itself.
This event will be fired after the popover is 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.m.Popover itself |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Attaches event handler
fnFunction
to the
beforeClose
event of this
sap.m.Popover
.
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.m.Popover
itself.
This event will be fired before the popover is closed.
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.m.Popover itself |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Attaches event handler
fnFunction
to the
beforeOpen
event of this
sap.m.Popover
.
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.m.Popover
itself.
This event will be fired before the popover is 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.m.Popover itself |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Closes the popover when it's already opened.
Returns:
Destroys the beginButton in the aggregation beginButton
.
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Destroys all the content in the aggregation content
.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Destroys the customHeader in the aggregation customHeader
.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Destroys the endButton in the aggregation endButton
.
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Destroys the footer in the aggregation footer
.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Destroys the subHeader in the aggregation subHeader
.
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
afterClose
event of this
sap.m.Popover
.
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:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
afterOpen
event of this
sap.m.Popover
.
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:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
beforeClose
event of this
sap.m.Popover
.
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:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
beforeOpen
event of this
sap.m.Popover
.
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:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Fires event
afterClose
to attached listeners.
Expects the following event parameters:
openBy
of type sap.ui.core.Control
This refers to the control which opens the popover.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Fires event
afterOpen
to attached listeners.
Expects the following event parameters:
openBy
of type sap.ui.core.Control
This refers to the control which opens the popover.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Fires event
beforeClose
to attached listeners.
Expects the following event parameters:
openBy
of type sap.ui.core.Control
This refers to the control which opens the popover.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Fires event
beforeOpen
to attached listeners.
Expects the following event parameters:
openBy
of type sap.ui.core.Control
This refers to the control which opens the popover.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy
.
Returns:
Gets content of aggregation
beginButton
.
BeginButton is shown at the left side (right side in RTL mode) inside the header. When showHeader is set to false, the property is ignored.
- Since:
- 1.15.1
Returns:
Gets content of aggregation
content
.
The content inside the popover.
Returns:
Gets current value of property
contentHeight
.
Set the height of the content area inside Popover. When controls which adapt their size to the parent control are added directly into Popover, for example sap.m.Page control, a size needs to be specified to the content area of the Popover. Otherwise, Popover control isn't able to display the content in the right way. This values isn't necessary for controls added to Popover directly which can decide their size by themselves, for exmaple sap.m.List, sap.m.Image etc., only needed for controls that adapt their size to the parent control.
- Since:
- 1.9.0
Returns:
Gets current value of property
contentMinWidth
.
Sets the minimum width of the content area inside popover.
Default value is
.
- Since:
- 1.36
Returns:
Gets current value of property
contentWidth
.
Set the width of the content area inside Popover. When controls which adapt their size to the parent control are added directly into Popover, for example sap.m.Page control, a size needs to be specified to the content area of the Popover. Otherwise, Popover control isn't able to display the content in the right way. This values isn't necessary for controls added to Popover directly which can decide their size by themselves, for exmaple sap.m.List, sap.m.Image etc., only needed for controls that adapt their size to the parent control.
- Since:
- 1.9.0
Returns:
Gets content of aggregation
customHeader
.
Any control that needed to be displayed in the header area. When this is set, the showHeader property is ignored, and only this customHeader is shown on the top of popover.
Returns:
Gets content of aggregation
endButton
.
EndButton is always shown at the right side (left side in RTL mode) inside the header. When showHeader is set to false, the property is ignored.
- Since:
- 1.15.1
Returns:
Gets content of aggregation
footer
.
This is optional footer which is shown on the bottom of the popover.
Returns:
getHorizontalScrolling(): boolean
Gets current value of property
horizontalScrolling
.
This property indicates if user can scroll horizontally inside popover when the content is bigger than the content area. However, when scrollable control (sap.m.ScrollContainer, sap.m.Page) is in the popover, this property needs to be set to false to disable the scrolling in popover in order to make the scrolling in the child control work properly. Popover detects if there's sap.m.NavContainer, sap.m.Page, or sap.m.ScrollContainer as direct child added to Popover. If there is, Popover will turn off scrolling by setting this property to false automatically ignoring the existing value of this property.
Default value is true
.
- Since:
- 1.15.0
Returns:
{boolean} | Value of property horizontalScrolling |
ID of the element which is the current target of the association initialFocus
, or null
.
- Since:
- 1.15.0
Returns:
getModal(): boolean
Gets current value of property
modal
.
If the popover will not be closed when tapping outside the popover. It also blocks any interaction with the background. The default value is false.
Default value is false
.
Returns:
{boolean} | Value of property modal |
getOffsetX(): int
Gets current value of property
offsetX
.
The offset for the popover placement in the x axis. It's with unit pixel.
Default value is 0
.
Returns:
{int} | Value of property offsetX |
getOffsetY(): int
Gets current value of property
offsetY
.
The offset for the popover placement in the y axis. It's with unit pixel.
Default value is 0
.
Returns:
{int} | Value of property offsetY |
Gets current value of property
placement
.
This is the information about on which side will the popover be placed at. Possible values are sap.m.PlacementType.Left, sap.m.PlacementType.Right, sap.m.PlacementType.Top, sap.m.PlacementType.Bottom, sap.m.PlacementType.Horizontal, sap.m.PlacementType.HorizontalPreferredLeft, sap.m.PlacementType.HorizontalPreferredRight, sap.m.PlacementType.Vertical, sap.m.PlacementType.VerticalPreferredTop, sap.m.PlacementType.VerticalPreferredBottom, sap.m.PlacementType.Auto. The default value is sap.m.PlacementType.Right. Setting this property while popover is open won't cause any rerendering of the popover, but it will take effect when it's opened again.
Default value is Right
.
Returns:
getResizable(): boolean
Gets current value of property
resizable
.
Whether resize option is enabled.
Default value is false
.
Experimental API:since 1.36.4 Do not use directly on Popover while in experimental mode!
- Experimental:
- since 1.36.4 Do not use directly on Popover while in experimental mode!
- Since:
- 1.36.4
Returns:
{boolean} | Value of property resizable |
getShowArrow(): boolean
Gets current value of property
showArrow
.
Whether Popover arrow should be visible
Default value is true
.
- Since:
- 1.31
Returns:
{boolean} | Value of property showArrow |
getShowHeader(): boolean
Gets current value of property
showHeader
.
If a header should be shown at the top of the popover.
Default value is true
.
Returns:
{boolean} | Value of property showHeader |
Gets content of aggregation
subHeader
.
When subHeader is assigned to Popover, it's rendered directly after the main header if there is, or at the beginning of Popover when there's no main header. SubHeader is out of the content area and won't be scrolled when content's size is bigger than the content area's size.
- Since:
- 1.15.1
Returns:
getTitle(): string
Gets current value of property
title
.
Title text appears in the header. This property will be ignored when showHeader is set to false.
Returns:
{string} | Value of property title |
getVerticalScrolling(): boolean
Gets current value of property
verticalScrolling
.
This property indicates if user can scroll vertically inside popover when the content is bigger than the content area. However, when scrollable control (sap.m.ScrollContainer, sap.m.Page) is in the popover, this property needs to be set to false to disable the scrolling in popover in order to make the scrolling in the child control work properly. Popover detects if there's sap.m.NavContainer, sap.m.Page, or sap.m.ScrollContainer as direct child added to Popover. If there is, Popover will turn off scrolling by setting this property to false automatically ignoring the existing value of this property.
Default value is true
.
- Since:
- 1.15.0
Returns:
{boolean} | Value of property verticalScrolling |
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 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:
{sap.m.Popover} | Reference to this in order to allow method chaining |
isOpen(): boolean
The method checks if the Popover is open. It returns true when the Popover is currently open (this includes opening and closing animations), otherwise it returns false.
- Since:
- 1.9.1
Returns:
{boolean} | whether the Popover is currently opened |
Opens the Popover and set the Popover position according to the
placement property around the
oControl
parameter.
Parameters:
{object} | oControl | This is the control to which the Popover will be placed. It can be not only a UI5 control, but also an existing DOM reference. The side of the placement depends on the placement property set in the Popover. |
{boolean} | bSkipInstanceManager | |
Returns:
Removes all the controls in the association named ariaDescribedBy
.
Returns:
Removes all the controls from the aggregation
content
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes an ariaDescribedBy from the association named ariaDescribedBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaDescribedBy | The ariaDescribedByto be removed or its index or ID |
Returns:
Removes a content from the aggregation content
.
Parameters:
Returns:
Sets the aggregated beginButton
.
Parameters:
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Setter for property
bounce
.
Default value is empty
Parameters:
{boolean} | bBounce | New value for property bounce |
Returns:
Sets a new value for property
contentHeight
.
Set the height of the content area inside Popover. When controls which adapt their size to the parent control are added directly into Popover, for example sap.m.Page control, a size needs to be specified to the content area of the Popover. Otherwise, Popover control isn't able to display the content in the right way. This values isn't necessary for controls added to Popover directly which can decide their size by themselves, for exmaple sap.m.List, sap.m.Image etc., only needed for controls that adapt their size to the parent control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
- Since:
- 1.9.0
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
contentMinWidth
.
Sets the minimum width of the content area inside popover.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
- Since:
- 1.36
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
contentWidth
.
Set the width of the content area inside Popover. When controls which adapt their size to the parent control are added directly into Popover, for example sap.m.Page control, a size needs to be specified to the content area of the Popover. Otherwise, Popover control isn't able to display the content in the right way. This values isn't necessary for controls added to Popover directly which can decide their size by themselves, for exmaple sap.m.List, sap.m.Image etc., only needed for controls that adapt their size to the parent control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
- Since:
- 1.9.0
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets the aggregated customHeader
.
Parameters:
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets the aggregated endButton
.
Parameters:
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
The followOf feature closes the Popover when the position of the control that opened the Popover changes by at least 32 pixels (on desktop browsers). This may lead to unwanted closing of the Popover.
This function is for enabling/disabling the followOf feature.
Parameters:
{boolean} | bValue | Enables the followOf feature |
- Since:
- 1.16.8
Returns:
Sets the aggregated footer
.
Parameters:
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
horizontalScrolling
.
This property indicates if user can scroll horizontally inside popover when the content is bigger than the content area. However, when scrollable control (sap.m.ScrollContainer, sap.m.Page) is in the popover, this property needs to be set to false to disable the scrolling in popover in order to make the scrolling in the child control work properly. Popover detects if there's sap.m.NavContainer, sap.m.Page, or sap.m.ScrollContainer as direct child added to Popover. If there is, Popover will turn off scrolling by setting this property to false automatically ignoring the existing value of this property.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bHorizontalScrolling | New value for property horizontalScrolling |
- Since:
- 1.15.0
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
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 |
- Since:
- 1.15.0
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Setter for property
modal
. This overwrites the default setter of the property
modal
to avoid rerendering the whole popover control.
Default value is false
Parameters:
{boolean} | bModal | New value for property modal . |
{string} | sModalCSSClass? | A CSS class (or space-separated list of classes) that should be added to the block layer. |
Returns:
Sets a new value for property
offsetX
.
The offset for the popover placement in the x axis. It's with unit pixel.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Parameters:
{int} | iOffsetX | New value for property offsetX |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
offsetY
.
The offset for the popover placement in the y axis. It's with unit pixel.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Parameters:
{int} | iOffsetY | New value for property offsetY |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Set the placement of the Popover.
Parameters:
Returns:
Sets a new value for property
resizable
.
Whether resize option is enabled.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Experimental API:since 1.36.4 Do not use directly on Popover while in experimental mode!
Parameters:
{boolean} | bResizable | New value for property resizable |
- Experimental:
- since 1.36.4 Do not use directly on Popover while in experimental mode!
- Since:
- 1.36.4
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
showArrow
.
Whether Popover arrow should be visible
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bShowArrow | New value for property showArrow |
- Since:
- 1.31
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets a new value for property
showHeader
.
If a header should be shown at the top of the popover.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bShowHeader | New value for property showHeader |
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets the aggregated subHeader
.
Parameters:
- Since:
- 1.15.1
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
The setter of the title property.
If you want to show a header in the popover, don't forget to set the showHeader property to true.
Parameters:
{string} | sTitle | The title to be set |
Returns:
Sets a new value for property
verticalScrolling
.
This property indicates if user can scroll vertically inside popover when the content is bigger than the content area. However, when scrollable control (sap.m.ScrollContainer, sap.m.Page) is in the popover, this property needs to be set to false to disable the scrolling in popover in order to make the scrolling in the child control work properly. Popover detects if there's sap.m.NavContainer, sap.m.Page, or sap.m.ScrollContainer as direct child added to Popover. If there is, Popover will turn off scrolling by setting this property to false automatically ignoring the existing value of this property.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bVerticalScrolling | New value for property verticalScrolling |
- Since:
- 1.15.0
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
getEnableScrolling(): boolean
Gets current value of property
enableScrolling
.
This property is deprecated. Please use properties verticalScrolling and horizontalScrolling instead. If you still use this property it will be mapped on the new properties verticalScrolling and horizontalScrolling.
Default value is true
.
- Deprecated:
- Since version 1.15.0. This property is deprecated. Please use properties verticalScrolling and horizontalScrolling instead. If you still use this property it will be mapped on the new properties verticalScrolling and horizontalScrolling.
Returns:
{boolean} | Value of property enableScrolling |
ID of the element which is the current target of the association leftButton
, or null
.
- Deprecated:
- Since version 1.15.1.
This property has been deprecated since 1.15.1. Please use the beginButton instead.
Returns:
ID of the element which is the current target of the association rightButton
, or null
.
- Deprecated:
- Since version 1.15.1.
This property has been deprecated since 1.15.1. Please use the endButton instead.
Returns:
Sets a new value for property
enableScrolling
.
This property is deprecated. Please use properties verticalScrolling and horizontalScrolling instead. If you still use this property it will be mapped on the new properties verticalScrolling and horizontalScrolling.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bEnableScrolling | New value for property enableScrolling |
- Deprecated:
- Since version 1.15.0. This property is deprecated. Please use properties verticalScrolling and horizontalScrolling instead. If you still use this property it will be mapped on the new properties verticalScrolling and horizontalScrolling.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets the associated leftButton
.
Parameters:
{sap.m.Button} | oLeftButton | Id of an element which becomes the new target of this leftButton association; alternatively, an element instance may be given |
- Deprecated:
- Since version 1.15.1.
This property has been deprecated since 1.15.1. Please use the beginButton instead.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |
Sets the associated rightButton
.
Parameters:
{sap.m.Button} | oRightButton | Id of an element which becomes the new target of this rightButton association; alternatively, an element instance may be given |
- Deprecated:
- Since version 1.15.1.
This property has been deprecated since 1.15.1. Please use the endButton instead.
Returns:
{sap.m.Popover} | Reference to this in order to allow method chaining |