abstract class sap.ui.core.TooltipBase

Control sample: sap.ui.core.TooltipBase
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/TooltipBase
Application Component: CA-UI5-COR

Abstract class that can be extended in order to implement any extended tooltip. For example, RichTooltip Control is based on it. It provides the opening/closing behavior and the main "text" property.


Constructor

Constructor for a new TooltipBase.

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.core.TooltipBase(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
atPosition sap.ui.core.Dock begin bottom

Optional. At position defines which position on the target control to align the positioned tooltip.

Visibility: public
closeDelay int 100

Closing delay of the tooltip in milliseconds

Visibility: public
closeDuration int 200

Optional. Close Duration in milliseconds.

Visibility: public
collision sap.ui.core.Collision flip

Optional. Collision - when the positioned element overflows the window in some direction, move it to an alternative position.

Visibility: public
myPosition sap.ui.core.Dock begin top

Optional. My position defines which position on the extended tooltip being positioned to align with the target control.

Visibility: public
offset string 10 3

Optional. Offset adds these left-top values to the calculated position. Example: "10 3".

Visibility: public
openDelay int 500

Opening delay of the tooltip in milliseconds

Visibility: public
openDuration int 200

Optional. Open Duration in milliseconds.

Visibility: public
text string empty string

The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip.

Visibility: public

Borrowed Properties

Name Type Default Value Description
blocked boolean false

Whether the control is currently in blocked state.

Visibility: public
busy boolean false

Whether the control is currently in busy state.

Visibility: public
busyIndicatorDelay int 1000

The delay in milliseconds, after which the busy indicator will show up for this control.

Visibility: public
busyIndicatorSize sap.ui.core.BusyIndicatorSize Medium

The size of the BusyIndicator. For controls with a width smaller 3rem a sap.ui.core.BusyIndicatorSize.Small should be used. If the size could vary in width and the width could get smaller than 3rem, the sap.ui.core.BusyIndicatorSize.Auto option could be used. The default is set to sap.ui.core.BusyIndicatorSize.Medium For a full screen BusyIndicator use sap.ui.core.BusyIndicatorSize.Large.

Since: 1.54.

Visibility: public
fieldGroupIds string[]

The IDs of a logical field group that this control belongs to.

All fields in a logical field group should share the same fieldGroupId. Once a logical field group is left, the validateFieldGroup event is fired.

For backward compatibility with older releases, field group IDs are syntactically not limited, but it is suggested to use only valid sap.ui.core.IDs.

See #attachValidateFieldGroup or consult the Field Group documentation.

Since: 1.31.

Visibility: public
visible boolean true

Whether the control should be visible on the screen.

If set to false, a placeholder will be rendered to mark the location of the invisible control in the DOM of the current page. The placeholder will be hidden and have zero dimensions (display: none).

Also see InvisibleRenderer.

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
customData 0..n sap.ui.core.CustomData

Custom Data, a data structure like a map containing arbitrary key value pairs.

dependents 0..n sap.ui.core.Element

Dependents are not rendered, but their databinding context and lifecycle are bound to the aggregating Element.

Since: 1.19.

dragDropConfig 0..n sap.ui.core.dnd.DragDropBase

Defines the drag-and-drop configuration. Note: This configuration might be ignored due to control metadata restrictions.

Since: 1.56.

layoutData 0..1 sap.ui.core.LayoutData

Defines the layout constraints for this control when it is used inside a Layout. LayoutData classes are typed classes and must match the embedding Layout. See VariantLayoutData for aggregating multiple alternative LayoutData instances to a single Element.

tooltip 0..1 sap.ui.core.TooltipBase

The tooltip that should be shown for this Element.

In the most simple case, a tooltip is a string that will be rendered by the control and displayed by the browser when the mouse pointer hovers over the control's DOM. In this variant, tooltip behaves like a simple control property.

Controls need to explicitly support this kind of tooltip as they have to render it, but most controls do. Exceptions will be documented for the corresponding controls (e.g. sap.ui.core.HTML does not support tooltips).

Alternatively, tooltip can act like a 0..1 aggregation and can be set to a tooltip control (an instance of a subclass of sap.ui.core.TooltipBase). In that case, the framework will take care of rendering the tooltip control in a popup-like manner. Such a tooltip control can display arbitrary content, not only a string.

UI5 currently does not provide a recommended implementation of TooltipBase as the use of content-rich tooltips is discouraged by the Fiori Design Guidelines. Existing subclasses of TooltipBase therefore have been deprecated. However, apps can still subclass from TooltipBase and create their own implementation when needed (potentially taking the deprecated implementations as a starting point).

See the section Using Tooltips in the Fiori Design Guideline.


Events Overview

Event Description
closed

This event is fired when the Tooltip has been closed

Since: 1.11.0.

closed

This event is fired when the Tooltip has been closed

Since: 1.11.0.

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

Methods Overview

Method Description
attachClosed

Attaches event handler fnFunction to the closed event of this sap.ui.core.TooltipBase.

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.TooltipBase itself.

This event is fired when the Tooltip has been closed

detachClosed

Detaches event handler fnFunction from the closed event of this sap.ui.core.TooltipBase.

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

sap.ui.core.TooltipBase.extend

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

fireClosed

Fires event closed to attached listeners.

getAtPosition

Gets current value of property atPosition.

Optional. At position defines which position on the target control to align the positioned tooltip.

Default value is 'begin bottom'.

getCloseDelay

Gets current value of property closeDelay.

Closing delay of the tooltip in milliseconds

Default value is 100.

getCloseDuration

Gets current value of property closeDuration.

Optional. Close Duration in milliseconds.

Default value is 200.

getCollision

Gets current value of property collision.

Optional. Collision - when the positioned element overflows the window in some direction, move it to an alternative position.

Default value is 'flip'.

sap.ui.core.TooltipBase.getMetadata

Returns a metadata object for class sap.ui.core.TooltipBase.

getMyPosition

Gets current value of property myPosition.

Optional. My position defines which position on the extended tooltip being positioned to align with the target control.

Default value is 'begin top'.

getOffset

Gets current value of property offset.

Optional. Offset adds these left-top values to the calculated position. Example: "10 3".

Default value is '10 3'.

getOpenDelay

Gets current value of property openDelay.

Opening delay of the tooltip in milliseconds

Default value is 500.

getOpenDuration

Gets current value of property openDuration.

Optional. Open Duration in milliseconds.

Default value is 200.

getText

Gets current value of property text.

The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip.

Default value is empty string.

setAtPosition

Sets a new value for property atPosition.

Optional. At position defines which position on the target control to align the positioned tooltip.

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

Default value is 'begin bottom'.

setCloseDelay

Sets a new value for property closeDelay.

Closing delay of the tooltip in milliseconds

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

Default value is 100.

setCloseDuration

Sets a new value for property closeDuration.

Optional. Close Duration in milliseconds.

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

Default value is 200.

setCollision

Sets a new value for property collision.

Optional. Collision - when the positioned element overflows the window in some direction, move it to an alternative position.

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

Default value is 'flip'.

setMyPosition

Sets a new value for property myPosition.

Optional. My position defines which position on the extended tooltip being positioned to align with the target control.

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

Default value is 'begin top'.

setOffset

Sets a new value for property offset.

Optional. Offset adds these left-top values to the calculated position. Example: "10 3".

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

Default value is '10 3'.

setOpenDelay

Sets a new value for property openDelay.

Opening delay of the tooltip in milliseconds

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

Default value is 500.

setOpenDuration

Sets a new value for property openDuration.

Optional. Open Duration in milliseconds.

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

Default value is 200.

setText

Sets a new value for property text.

The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip.

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

Default value is empty string.

attachClosed

Attaches event handler fnFunction to the closed event of this sap.ui.core.TooltipBase.

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.TooltipBase itself.

This event is fired when the Tooltip has been closed

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.core.TooltipBase itself

detachClosed

Detaches event handler fnFunction from the closed event of this sap.ui.core.TooltipBase.

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.core.TooltipBase.extend

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

fireClosed

Fires event closed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAtPosition

Gets current value of property atPosition.

Optional. At position defines which position on the target control to align the positioned tooltip.

Default value is 'begin bottom'.

getCloseDelay

Gets current value of property closeDelay.

Closing delay of the tooltip in milliseconds

Default value is 100.

getCloseDuration

Gets current value of property closeDuration.

Optional. Close Duration in milliseconds.

Default value is 200.

getCollision

Gets current value of property collision.

Optional. Collision - when the positioned element overflows the window in some direction, move it to an alternative position.

Default value is 'flip'.

sap.ui.core.TooltipBase.getMetadata

Returns a metadata object for class sap.ui.core.TooltipBase.

getMyPosition

Gets current value of property myPosition.

Optional. My position defines which position on the extended tooltip being positioned to align with the target control.

Default value is 'begin top'.

getOffset

Gets current value of property offset.

Optional. Offset adds these left-top values to the calculated position. Example: "10 3".

Default value is '10 3'.

getOpenDelay

Gets current value of property openDelay.

Opening delay of the tooltip in milliseconds

Default value is 500.

getOpenDuration

Gets current value of property openDuration.

Optional. Open Duration in milliseconds.

Default value is 200.

getText

Gets current value of property text.

The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip.

Default value is empty string.

setAtPosition

Sets a new value for property atPosition.

Optional. At position defines which position on the target control to align the positioned tooltip.

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

Default value is 'begin bottom'.

Param Type DefaultValue Description
sAtPosition sap.ui.core.Dock 'begin bottom'

New value for property atPosition

setCloseDelay

Sets a new value for property closeDelay.

Closing delay of the tooltip in milliseconds

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

Default value is 100.

Param Type DefaultValue Description
iCloseDelay int 100

New value for property closeDelay

setCloseDuration

Sets a new value for property closeDuration.

Optional. Close Duration in milliseconds.

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

Default value is 200.

Param Type DefaultValue Description
iCloseDuration int 200

New value for property closeDuration

setCollision

Sets a new value for property collision.

Optional. Collision - when the positioned element overflows the window in some direction, move it to an alternative position.

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

Default value is 'flip'.

Param Type DefaultValue Description
sCollision sap.ui.core.Collision 'flip'

New value for property collision

setMyPosition

Sets a new value for property myPosition.

Optional. My position defines which position on the extended tooltip being positioned to align with the target control.

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

Default value is 'begin top'.

Param Type DefaultValue Description
sMyPosition sap.ui.core.Dock 'begin top'

New value for property myPosition

setOffset

Sets a new value for property offset.

Optional. Offset adds these left-top values to the calculated position. Example: "10 3".

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

Default value is '10 3'.

Param Type DefaultValue Description
sOffset string '10 3'

New value for property offset

setOpenDelay

Sets a new value for property openDelay.

Opening delay of the tooltip in milliseconds

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

Default value is 500.

Param Type DefaultValue Description
iOpenDelay int 500

New value for property openDelay

setOpenDuration

Sets a new value for property openDuration.

Optional. Open Duration in milliseconds.

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

Default value is 200.

Param Type DefaultValue Description
iOpenDuration int 200

New value for property openDuration

setText

Sets a new value for property text.

The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip.

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

Default value is empty string.

Param Type DefaultValue Description
sText string ""

New value for property text