Class sap.ui.commons.CalloutBaseModule: sap/ui/commons/CalloutBase

extends TooltipBase
known direct subclasses: Callout, QuickView

CalloutBase is a building block for Callout. Do not use it directly. Use the Callout control instead

Deprecated API:Since version 1.38. Instead, use the sap.m.Popover control.

Constructor Summary
new sap.ui.commons.CalloutBase(sId?, mSettings?)Constructor for a new CalloutBase.
Event Summary
beforeOpen(oControlEvent)Event is fired before a Callout is displayed.
close(oControlEvent)Event is fired when the Callout window is closed.
open(oControlEvent)The event is fired when the popup is opened.
opened(oControlEvent)Is fired when the Callout has been opened
Events borrowed from class sap.ui.core.TooltipBase
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.CalloutBase.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.CalloutBase with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.CalloutBase.getMetadata()Returns a metadata object for class sap.ui.commons.CalloutBase.
adjustPosition()Adjust position of the already opened Callout window.
attachBeforeOpen(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the beforeOpen event of this sap.ui.commons.CalloutBase.
attachClose(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the close event of this sap.ui.commons.CalloutBase.
attachOpen(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the open event of this sap.ui.commons.CalloutBase.
attachOpened(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the opened event of this sap.ui.commons.CalloutBase.
close()Closes Callout
detachBeforeOpen(fnFunction, oListener)Detaches event handler fnFunction from the beforeOpen event of this sap.ui.commons.CalloutBase.
detachClose(fnFunction, oListener)Detaches event handler fnFunction from the close event of this sap.ui.commons.CalloutBase.
detachOpen(fnFunction, oListener)Detaches event handler fnFunction from the open event of this sap.ui.commons.CalloutBase.
detachOpened(fnFunction, oListener)Detaches event handler fnFunction from the opened event of this sap.ui.commons.CalloutBase.
fireBeforeOpen(mArguments?)Fires event beforeOpen to attached listeners.
fireClose(mArguments?)Fires event close to attached listeners.
fireOpen(mArguments?)Fires event open to attached listeners.
fireOpened(mArguments?)Fires event opened to attached listeners.
setPosition(myPosition, atPosition)Set position of the Callout window relative to the parent control.
Constructor Detail
new sap.ui.commons.CalloutBase(sId?, mSettings?)
Constructor for a new CalloutBase.

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

The supported settings are:

  • Events
    • open : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • close : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • beforeOpen : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • opened : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.TooltipBase can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Deprecated:
Since version 1.38. Instead, use the sap.m.Popover control.
Event Detail
beforeOpen(oControlEvent)
Event is fired before a Callout is displayed. Call the preventDefault method of the event object to postpone opening. Application may use this event to start asynchronous Ajax call to load the Callout content
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Control}oControlEvent.getParameters.parent Parent control that has this Callout as a tooltip
close(oControlEvent)
Event is fired when the Callout window is closed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
open(oControlEvent)
The event is fired when the popup is opened.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Control}oControlEvent.getParameters.parent Parent control that has this Callout as a tooltip
opened(oControlEvent)
Is fired when the Callout has been opened
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Since:
1.11.0
Method Detail
sap.ui.commons.CalloutBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.CalloutBase 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.TooltipBase.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.commons.CalloutBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.CalloutBase.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
adjustPosition(): void
Adjust position of the already opened Callout window. Call this method each time when the size of the opened Callout window may be changed due to new or changed contents.
attachBeforeOpen(oData?, fnFunction, oListener?): sap.ui.commons.CalloutBase
Attaches event handler fnFunction to the beforeOpen event of this sap.ui.commons.CalloutBase.

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.commons.CalloutBase itself.

Event is fired before a Callout is displayed. Call the preventDefault method of the event object to postpone opening. Application may use this event to start asynchronous Ajax call to load the Callout content

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.commons.CalloutBase itself
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
attachClose(oData?, fnFunction, oListener?): sap.ui.commons.CalloutBase
Attaches event handler fnFunction to the close event of this sap.ui.commons.CalloutBase.

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.commons.CalloutBase itself.

Event is fired when the Callout window 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.ui.commons.CalloutBase itself
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
attachOpen(oData?, fnFunction, oListener?): sap.ui.commons.CalloutBase
Attaches event handler fnFunction to the open event of this sap.ui.commons.CalloutBase.

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.commons.CalloutBase itself.

The event is fired when the popup 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.ui.commons.CalloutBase itself
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
attachOpened(oData?, fnFunction, oListener?): sap.ui.commons.CalloutBase
Attaches event handler fnFunction to the opened event of this sap.ui.commons.CalloutBase.

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.commons.CalloutBase itself.

Is fired when the Callout 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.commons.CalloutBase itself
Since:
1.11.0
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
close(): void
Closes Callout
detachBeforeOpen(fnFunction, oListener): sap.ui.commons.CalloutBase
Detaches event handler fnFunction from the beforeOpen event of this sap.ui.commons.CalloutBase.

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.ui.commons.CalloutBase} Reference to this in order to allow method chaining
detachClose(fnFunction, oListener): sap.ui.commons.CalloutBase
Detaches event handler fnFunction from the close event of this sap.ui.commons.CalloutBase.

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.ui.commons.CalloutBase} Reference to this in order to allow method chaining
detachOpen(fnFunction, oListener): sap.ui.commons.CalloutBase
Detaches event handler fnFunction from the open event of this sap.ui.commons.CalloutBase.

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.ui.commons.CalloutBase} Reference to this in order to allow method chaining
detachOpened(fnFunction, oListener): sap.ui.commons.CalloutBase
Detaches event handler fnFunction from the opened event of this sap.ui.commons.CalloutBase.

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.11.0
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
fireBeforeOpen(mArguments?): boolean
Fires event beforeOpen to attached listeners.

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

Expects the following event parameters:

  • parent of type sap.ui.core.ControlParent control that has this Callout as a tooltip
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{boolean} Whether or not to prevent the default action
fireClose(mArguments?): sap.ui.commons.CalloutBase
Fires event close to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
fireOpen(mArguments?): sap.ui.commons.CalloutBase
Fires event open to attached listeners.

Expects the following event parameters:

  • parent of type sap.ui.core.ControlParent control that has this Callout as a tooltip
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
fireOpened(mArguments?): sap.ui.commons.CalloutBase
Fires event opened to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.11.0
Returns:
{sap.ui.commons.CalloutBase} Reference to this in order to allow method chaining
setPosition(myPosition, atPosition): sap.ui.commons.CalloutBase
Set position of the Callout window relative to the parent control. This function automatically calculates and sets the correct offset, use it instead of setMyPosition/setAtPosition.
Parameters:
{sap.ui.core.Dock}myPosition docking position of the Callout
{sap.ui.core.Dock}atPosition docking position of the parent control
Returns:
{sap.ui.commons.CalloutBase}this to allow method chaining