class sap.ui.mdc.Link

Control sample: sap.ui.mdc.Link
Visiblity: restricted
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/mdc/Link
Application Component: CA-UI5-MDC

A Link control can be used to handle navigation scenarios with one or more targets through direct navigation or by opening a sap.ui.mdc.link.Panel.
It can also be used to display additional content, such as sap.ui.mdc.link.ContactDetails on the sap.ui.mdc.link.Panel. Note: Navigation targets are determined by the implementation of a sap.ui.mdc.LinkDelegate.


Constructor

Constructor for the new Link

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.mdc.Link(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
delegate object ...see text or source

Path to LinkDelegate module that provides the required APIs to create content for the Link control.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. Once the required module is associated, this property might not be needed any longer.

Visibility: public
enablePersonalization boolean true

Enables/disables the personalization settings for users and key users.

Visibility: public

Borrowed Properties

Name Type Default Value Description
delegate object

Path to the Delegate module that provides the required APIs to execute model-specific logic.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. This property can only be configured during control initialization.

Visibility: public

Associations

Name Cardinality Type Description
sourceControl 0..1 sap.ui.core.Control

Gets the app component required for link personalization. Also, the source control is used to get the binding context.


Methods Overview

Method Description
sap.ui.mdc.Link.extend

Creates a new subclass of class sap.ui.mdc.Link 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.mdc.field.FieldInfoBase.extend.

getContent

Function that is called in the createPopover function of sap.ui.mdc.field.FieldInfoBase.

getDelegate

Gets current value of property delegate.

Path to LinkDelegate module that provides the required APIs to create content for the Link control.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. Once the required module is associated, this property might not be needed any longer.

Default value is ...see text or source.

getDirectLinkHrefAndTarget

Returns an object containing href and target of the direct navigation. Returns null if there is no direct link.

getEnablePersonalization

Gets current value of property enablePersonalization.

Enables/disables the personalization settings for users and key users.

Default value is true.

sap.ui.mdc.Link.getMetadata

Returns a metadata object for class sap.ui.mdc.Link.

getSourceControl

ID of the element which is the current target of the association sourceControl, or null.

getTriggerHref

Returns an href of direct link navigation, once the Promise has been resolved.

isTriggerable

Checks if FieldInfo is clickable and therefore rendered as a Link control.

retrieveAdditionalContent
sap.ui.mdc.Link.retrieveAllMetadata

Retrieves the relevant metadata for the panel and returns a property info array.

sap.ui.mdc.Link.retrieveBaseline

Retrieves the items that are initially part of the baseline which is used when a reset is done.

retrieveLinkItems

Calls the modifyLinkItems function of Delegate before returning the LinkItem objects.

retrieveLinkType
setDelegate

Sets a new value for property delegate.

Path to LinkDelegate module that provides the required APIs to create content for the Link control.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. Once the required module is associated, this property might not be needed any longer.

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

Default value is ...see text or source.

setEnablePersonalization

Sets a new value for property enablePersonalization.

Enables/disables the personalization settings for users and key users.

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

Default value is true.

setSourceControl

Sets the associated sourceControl.

sap.ui.mdc.Link.extend

Creates a new subclass of class sap.ui.mdc.Link 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.mdc.field.FieldInfoBase.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

getContent

Function that is called in the createPopover function of sap.ui.mdc.field.FieldInfoBase.

Param Type DefaultValue Description
fnGetAutoClosedControl function

Function returning the Popover control that is created in createPopover

getDelegate

Gets current value of property delegate.

Path to LinkDelegate module that provides the required APIs to create content for the Link control.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. Once the required module is associated, this property might not be needed any longer.

Default value is ...see text or source.

getDirectLinkHrefAndTarget

Returns an object containing href and target of the direct navigation. Returns null if there is no direct link.

getEnablePersonalization

Gets current value of property enablePersonalization.

Enables/disables the personalization settings for users and key users.

Default value is true.

sap.ui.mdc.Link.getMetadata

Returns a metadata object for class sap.ui.mdc.Link.

getSourceControl

ID of the element which is the current target of the association sourceControl, or null.

getTriggerHref

Returns an href of direct link navigation, once the Promise has been resolved.

isTriggerable

Checks if FieldInfo is clickable and therefore rendered as a Link control.

retrieveAdditionalContent

sap.ui.mdc.Link.retrieveAllMetadata

Retrieves the relevant metadata for the panel and returns a property info array.

Param Type DefaultValue Description
oPanel sap.ui.mdc.link.Panel

Instance of a Panel control

sap.ui.mdc.Link.retrieveBaseline

Retrieves the items that are initially part of the baseline which is used when a reset is done.

Param Type DefaultValue Description
oPanel sap.ui.mdc.link.Panel

Instance of a Panel control

retrieveLinkItems

Calls the modifyLinkItems function of Delegate before returning the LinkItem objects.

retrieveLinkType

setDelegate

Sets a new value for property delegate.

Path to LinkDelegate module that provides the required APIs to create content for the Link control.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. Once the required module is associated, this property might not be needed any longer.

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

Default value is ...see text or source.

Param Type DefaultValue Description
oDelegate object ...see text or source

New value for property delegate

setEnablePersonalization

Sets a new value for property enablePersonalization.

Enables/disables the personalization settings for users and key users.

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

Default value is true.

Param Type DefaultValue Description
bEnablePersonalization boolean true

New value for property enablePersonalization

setSourceControl

Sets the associated sourceControl.

Param Type DefaultValue Description
oSourceControl sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this sourceControl association; alternatively, an element instance may be given