class sap.ui.comp.navpopover.SmartLink

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends: sap.m.Link
Module: sap/ui/comp/navpopover/SmartLink
Application Component: CA-UI5-CMP

The SmartLink control uses a semantic object to display NavigationPopover for further navigation steps.
Note: Navigation targets are determined using CrossApplicationNavigation of the unified shell service.

Important: Keep in mind that SmartLink, like all SAPUI5 smart controls, retrieves and analyzes the metadata and annotations of OData services. The OData metadata is its primary API. These OData services are not part of the SAPUI5 framework and are usually maintained by the backend developers of your application.

With time, SmartLink can evolve and acquire new features. This means that its behavior or functionalities may change if the annotations that define this change are maintained in your backend metadata. To benefit from the new functionalities, your application should be able to adapt the backend metadata. Therefore, we recommend using SmartLink only if you have control over the metadata of your application.


Constructor

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.comp.navpopover.SmartLink(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
additionalSemanticObjects string[]

Semantic object names which can be used additional to the default semanticObject property in order to get navigation targets links.

Since: 1.42.0.

Visibility: public
beforeNavigationCallback function

Function that is called before the actual navigation happens. This function has to return a promise resolving into a Boolean value for which the navigation will wait. If the Boolean value is true, the navigation will be processed. The beforeNavigationCallback(oNavigationInfo) parameter contains the following data:

  • {String} text: Text of the navigation intent
  • {String} href: HREF of the navigation intent
  • {String} originalId: ID of the control that fires the navigation intent
  • {String} semanticObject: Name of the SemanticObject of the navigation intent
  • {Object} semanticAttributes: Object containing the SemanticAttributes of the navigation intent


Since: 1.75.0.

Visibility: public
contactAnnotationPath string undefined

Navigation property that points from the current to the related entity type where the com.sap.vocabularies.Communication.v1.Contact annotation is defined, for example, 'to_Supplier'. An empty string means that the related entity type is the current one.

Since: 1.40.0.

Visibility: public
createControlCallback object

Function that enables the SmartLink control to create an alternative control, which is displayed if no navigation targets are available. The function has no parameters and has to return an instance of sap.ui.core.Control.

Since: 1.28.0.

Visibility: public
enableAvailableActionsPersonalization boolean true

Determines whether the personalization link is shown inside the NavigationPopover control.

Since: 1.44.0.

Visibility: public
fieldName string

The metadata field name for this SmartLink control.

Since: 1.28.0.

Visibility: public
forceLinkRendering boolean false

If set to true, the SmartLink control is rendered as a link even if contactAnnotationPath is not set and navigation targets do not exist. Setting this property to true allows the application, for example, to modify the SmartLink control in the event handler, after the user has clicked on a link and the registered event handler has been called.

Note: The ignoreLinkRendering property and the ignoredFields property of the associated SemanticObjectController take precedence over forceLinkRendering.

Since: 1.58.0.

Visibility: public
ignoreLinkRendering boolean false

If set to true, the SmartLink control will render the innerControl or the control provided by createControlCallback instead of the actual link. This is used for example by the SemanticObjectController if this SmartLink is listed in its ignoredFields or no navigation targets were found during prefetch.

Since: 1.28.0.

Visibility: public
mapFieldToSemanticObject boolean true

If set to false, the SmartLink control will not replace its field name with the according semanticObject property during the calculation of the semantic attributes. This enables the usage of several SmartLink controls on the same semantic object.

Visibility: public
semanticObject string

Name of semantic object which is used to fill the navigation popover. Note: Setting a value triggers an asynchronous determination, so the effect can be delayed.

Since: 1.28.0.

Visibility: public
semanticObjectController any

The semantic object controller controls events for several SmartLink controls. If the controller is not set manually, it tries to find a SemanticObjectController in its parent hierarchy.

Since: 1.28.0.

Visibility: public
semanticObjectLabel string

Shown label of semantic object.

Since: 1.28.0.

Visibility: public
uom string undefined

Additionally to the text property the Unit of Measure can be displayed.

Since: 1.48.0.

Visibility: public

Aggregations

Default Aggregation:

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

Control that is displayed instead of SmartLink control, if the SmartLink is disabled (for example, if no navigation targets are available). If innerControl is not provided, the SmartLink control tries to create one with property createControlCallback.

Since: 1.28.0.


Events Overview

Event Description
beforePopoverOpens

Event is fired before the navigation popover opens and before navigation target links are getting retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink control, the beforePopoverOpens is fired after the link has been clicked.

Since: 1.28.0.

innerNavigate

This event is fired after a navigation link on the navigation popover has been clicked. This event is only fired, if the user left-clicks the link. Right-clicking the link and selecting 'Open in New Window' etc. in the context menu does not fire the event.

Since: 1.28.0.

navigationTargetsObtained

After the navigation targets are retrieved, navigationTargetsObtained is fired and provides the possibility to change the targets.

Since: 1.28.0.

beforePopoverOpens

Event is fired before the navigation popover opens and before navigation target links are getting retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink control, the beforePopoverOpens is fired after the link has been clicked.

Since: 1.28.0.

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

The semantic object for which the navigation targets will be retrieved.

semanticAttributes object

Map containing the semantic attributes calculated from the binding that will be used to retrieve the navigation targets.

semanticAttributesOfSemanticObjects object

A map of semantic objects for which the navigation targets will be retrieved and it's semantic attributes calculated from the binding context. The semantic attributes will be used as parameters in order to retrieve the navigation targets.

Since: 1.42.0.

setSemanticAttributes function

This callback function enables you to define a changed semantic attributes map. Signatures: setSemanticAttributes(oSemanticAttributesMap) Parameter:

  • {object} oSemanticAttributesMap New map containing the semantic attributes
  • {string} sSemanticObject Semantic Object for which the oSemanticAttributesMap belongs

setAppStateKey function

This callback function sets an application state key that is used over the cross-application navigation. Signatures: setAppStateKey(sAppStateKey) Parameter:

  • {string} sAppStateKey

originalId string

The ID of the SmartLink control.

open function

This callback function triggers the retrieval of navigation targets and leads to the opening of the navigation popover. Signatures: open() If the beforePopoverOpens has been registered, the open function has to be called manually in order to open the navigation popover.

innerNavigate

This event is fired after a navigation link on the navigation popover has been clicked. This event is only fired, if the user left-clicks the link. Right-clicking the link and selecting 'Open in New Window' etc. in the context menu does not fire the event.

Since: 1.28.0.

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

The UI text shown in the clicked link.

href string

The navigation target of the clicked link.

semanticObject string

The semantic object used to retrieve this target.

semanticAttributes object

Map containing the semantic attributes used to retrieve this target.

originalId string

The ID of the SmartLink control.

navigationTargetsObtained

After the navigation targets are retrieved, navigationTargetsObtained is fired and provides the possibility to change the targets.

Since: 1.28.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
mainNavigation sap.ui.comp.navpopover.LinkData

The main navigation object.

actions sap.ui.comp.navpopover.LinkData[]

Array of available navigation target objects.

ownNavigation sap.ui.comp.navpopover.LinkData

The navigation object for the own application. This navigation option is by default not visible on the popover.

popoverForms sap.ui.layout.form.SimpleForm[]

Array containing contact data.

semanticObject string

The semantic object for which the navigation targets have been retrieved.

semanticAttributes object

Map containing the semantic attributes.

originalId string

The ID of the SmartLink control.

show function

This callback function shows the actual navigation popover. If the navigationTargetsObtained has been registered, the show function has to be called manually in order to open the navigation popover. Signatures: show()

  • show(oMainNavigation, aAvailableActions, oAdditionalContent) Parameters:
    • {sap.ui.comp.navpopover.LinkData | null | undefined} oMainNavigation The main navigation object. With null the main navigation object will be removed. With undefined the old object will remain.
    • {sap.ui.comp.navpopover.LinkData[] | [] | undefined} aAvailableActions Array containing the cross application navigation links. With empty array all available links will be removed. With undefined the old links will remain.
    • {sap.ui.core.Control | null | undefined} oAdditionalContent Control that will be displayed in extra content section on the popover. With null the main extra content object will be removed. With undefined the old object still remains.
  • show(sMainNavigationId, oMainNavigation, aAvailableActions, oAdditionalContent) Parameters:
    • {string | undefined} sMainNavigationId The visible description for the main navigation link. With '', both the description and subtitle will be removed. With undefined, the description is calculated using the binding context of a given source object (for example SmartLink control).
    • {sap.ui.comp.navpopover.LinkData | null | undefined} oMainNavigation The main navigation object. With null the main navigation object will be removed. With undefined the old object will remain.
    • {sap.ui.comp.navpopover.LinkData[] | [] | undefined} aAvailableActions Array containing the cross application navigation links. With empty array all available links will be removed. With undefined the old links will remain.
    • {sap.ui.core.Control | null | undefined} oAdditionalContent Control that will be displayed in extra content section on the popover. With null the main extra content object will be removed. With undefined the old object still remains.


Methods Overview

Method Description
attachBeforePopoverOpens

Attaches event handler fnFunction to the beforePopoverOpens event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

Event is fired before the navigation popover opens and before navigation target links are getting retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink control, the beforePopoverOpens is fired after the link has been clicked.

attachInnerNavigate

Attaches event handler fnFunction to the innerNavigate event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

This event is fired after a navigation link on the navigation popover has been clicked. This event is only fired, if the user left-clicks the link. Right-clicking the link and selecting 'Open in New Window' etc. in the context menu does not fire the event.

attachNavigationTargetsObtained

Attaches event handler fnFunction to the navigationTargetsObtained event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

After the navigation targets are retrieved, navigationTargetsObtained is fired and provides the possibility to change the targets.

destroyInnerControl

Destroys the innerControl in the aggregation innerControl.

detachBeforePopoverOpens

Detaches event handler fnFunction from the beforePopoverOpens event of this sap.ui.comp.navpopover.SmartLink.

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

detachInnerNavigate

Detaches event handler fnFunction from the innerNavigate event of this sap.ui.comp.navpopover.SmartLink.

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

detachNavigationTargetsObtained

Detaches event handler fnFunction from the navigationTargetsObtained event of this sap.ui.comp.navpopover.SmartLink.

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

sap.ui.comp.navpopover.SmartLink.extend

Creates a new subclass of class sap.ui.comp.navpopover.SmartLink with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.Link.extend.

fireBeforePopoverOpens

Fires event beforePopoverOpens to attached listeners.

fireInnerNavigate

Fires event innerNavigate to attached listeners.

fireNavigationTargetsObtained

Fires event navigationTargetsObtained to attached listeners.

getAdditionalSemanticObjects

Gets current value of property additionalSemanticObjects.

Semantic object names which can be used additional to the default semanticObject property in order to get navigation targets links.

Default value is [].

getBeforeNavigationCallback

Gets current value of property beforeNavigationCallback.

Function that is called before the actual navigation happens. This function has to return a promise resolving into a Boolean value for which the navigation will wait. If the Boolean value is true, the navigation will be processed. The beforeNavigationCallback(oNavigationInfo) parameter contains the following data:

  • {String} text: Text of the navigation intent
  • {String} href: HREF of the navigation intent
  • {String} originalId: ID of the control that fires the navigation intent
  • {String} semanticObject: Name of the SemanticObject of the navigation intent
  • {Object} semanticAttributes: Object containing the SemanticAttributes of the navigation intent

getContactAnnotationPath

Gets current value of property contactAnnotationPath.

Navigation property that points from the current to the related entity type where the com.sap.vocabularies.Communication.v1.Contact annotation is defined, for example, 'to_Supplier'. An empty string means that the related entity type is the current one.

Default value is undefined.

getCreateControlCallback

Gets current value of property createControlCallback.

Function that enables the SmartLink control to create an alternative control, which is displayed if no navigation targets are available. The function has no parameters and has to return an instance of sap.ui.core.Control.

getEnableAvailableActionsPersonalization

Gets current value of property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control.

Default value is true.

getFieldName

Gets current value of property fieldName.

The metadata field name for this SmartLink control.

getForceLinkRendering

Gets current value of property forceLinkRendering.

If set to true, the SmartLink control is rendered as a link even if contactAnnotationPath is not set and navigation targets do not exist. Setting this property to true allows the application, for example, to modify the SmartLink control in the event handler, after the user has clicked on a link and the registered event handler has been called.

Note: The ignoreLinkRendering property and the ignoredFields property of the associated SemanticObjectController take precedence over forceLinkRendering.

Default value is false.

getIgnoreLinkRendering

Gets current value of property ignoreLinkRendering.

If set to true, the SmartLink control will render the innerControl or the control provided by createControlCallback instead of the actual link. This is used for example by the SemanticObjectController if this SmartLink is listed in its ignoredFields or no navigation targets were found during prefetch.

Default value is false.

getInnerControl

Gets content of aggregation innerControl.

Control that is displayed instead of SmartLink control, if the SmartLink is disabled (for example, if no navigation targets are available). If innerControl is not provided, the SmartLink control tries to create one with property createControlCallback.

getInnerControlValue

Gets the inner control's value, if no inner control is available, the text of SmartLink control will be returned.

getMapFieldToSemanticObject

Gets current value of property mapFieldToSemanticObject.

If set to false, the SmartLink control will not replace its field name with the according semanticObject property during the calculation of the semantic attributes. This enables the usage of several SmartLink controls on the same semantic object.

Default value is true.

sap.ui.comp.navpopover.SmartLink.getMetadata

Returns a metadata object for class sap.ui.comp.navpopover.SmartLink.

getSemanticObject

Gets current value of property semanticObject.

Name of semantic object which is used to fill the navigation popover. Note: Setting a value triggers an asynchronous determination, so the effect can be delayed.

getSemanticObjectController

Gets current value of property semanticObjectController.

The semantic object controller controls events for several SmartLink controls. If the controller is not set manually, it tries to find a SemanticObjectController in its parent hierarchy.

getSemanticObjectLabel

Gets current value of property semanticObjectLabel.

Shown label of semantic object.

Since 1.40.0 Title section with <code>semanticObjectLabel</code> has been removed due to new UI design
getUom

Gets current value of property uom.

Additionally to the text property the Unit of Measure can be displayed.

Default value is undefined.

setAdditionalSemanticObjects

Sets a new value for property additionalSemanticObjects.

Semantic object names which can be used additional to the default semanticObject property in order to get navigation targets links.

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

Default value is [].

setContactAnnotationPath

Sets a new value for property contactAnnotationPath.

Navigation property that points from the current to the related entity type where the com.sap.vocabularies.Communication.v1.Contact annotation is defined, for example, 'to_Supplier'. An empty string means that the related entity type is the current one.

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

Default value is undefined.

setCreateControlCallback

Sets a new value for property createControlCallback.

Function that enables the SmartLink control to create an alternative control, which is displayed if no navigation targets are available. The function has no parameters and has to return an instance of sap.ui.core.Control.

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

setEnableAvailableActionsPersonalization

Sets a new value for property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control.

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

Default value is true.

setFieldName

Sets a new value for property fieldName.

The metadata field name for this SmartLink control.

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

setForceLinkRendering

Sets a new value for property forceLinkRendering.

If set to true, the SmartLink control is rendered as a link even if contactAnnotationPath is not set and navigation targets do not exist. Setting this property to true allows the application, for example, to modify the SmartLink control in the event handler, after the user has clicked on a link and the registered event handler has been called.

Note: The ignoreLinkRendering property and the ignoredFields property of the associated SemanticObjectController take precedence over forceLinkRendering.

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

Default value is false.

setIgnoreLinkRendering

Sets a new value for property ignoreLinkRendering.

If set to true, the SmartLink control will render the innerControl or the control provided by createControlCallback instead of the actual link. This is used for example by the SemanticObjectController if this SmartLink is listed in its ignoredFields or no navigation targets were found during prefetch.

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

Default value is false.

setInnerControl

Sets the aggregated innerControl.

setMapFieldToSemanticObject

Sets a new value for property mapFieldToSemanticObject.

If set to false, the SmartLink control will not replace its field name with the according semanticObject property during the calculation of the semantic attributes. This enables the usage of several SmartLink controls on the same semantic object.

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

Default value is true.

setSemanticObject

Sets a new value for property semanticObject.

Name of semantic object which is used to fill the navigation popover. Note: Setting a value triggers an asynchronous determination, so the effect can be delayed.

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

setSemanticObjectController

Sets a new value for property semanticObjectController.

The semantic object controller controls events for several SmartLink controls. If the controller is not set manually, it tries to find a SemanticObjectController in its parent hierarchy.

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

setSemanticObjectLabel

Sets a new value for property semanticObjectLabel.

Shown label of semantic object.

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

Since 1.40.0 Title section with <code>semanticObjectLabel</code> has been removed due to new UI design
setUom

Sets a new value for property uom.

Additionally to the text property the Unit of Measure can be displayed.

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

Default value is undefined.

attachBeforePopoverOpens

Attaches event handler fnFunction to the beforePopoverOpens event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

Event is fired before the navigation popover opens and before navigation target links are getting retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink control, the beforePopoverOpens is fired after the link has been clicked.

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.comp.navpopover.SmartLink itself

attachInnerNavigate

Attaches event handler fnFunction to the innerNavigate event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

This event is fired after a navigation link on the navigation popover has been clicked. This event is only fired, if the user left-clicks the link. Right-clicking the link and selecting 'Open in New Window' etc. in the context menu does not fire the event.

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.comp.navpopover.SmartLink itself

attachNavigationTargetsObtained

Attaches event handler fnFunction to the navigationTargetsObtained event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink itself.

After the navigation targets are retrieved, navigationTargetsObtained is fired and provides the possibility to change the targets.

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.comp.navpopover.SmartLink itself

destroyInnerControl

Destroys the innerControl in the aggregation innerControl.

detachBeforePopoverOpens

Detaches event handler fnFunction from the beforePopoverOpens event of this sap.ui.comp.navpopover.SmartLink.

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

detachInnerNavigate

Detaches event handler fnFunction from the innerNavigate event of this sap.ui.comp.navpopover.SmartLink.

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

detachNavigationTargetsObtained

Detaches event handler fnFunction from the navigationTargetsObtained event of this sap.ui.comp.navpopover.SmartLink.

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.comp.navpopover.SmartLink.extend

Creates a new subclass of class sap.ui.comp.navpopover.SmartLink with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.Link.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

fireBeforePopoverOpens

Fires event beforePopoverOpens to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

semanticObject string

The semantic object for which the navigation targets will be retrieved.

semanticAttributes object

Map containing the semantic attributes calculated from the binding that will be used to retrieve the navigation targets.

semanticAttributesOfSemanticObjects object

A map of semantic objects for which the navigation targets will be retrieved and it's semantic attributes calculated from the binding context. The semantic attributes will be used as parameters in order to retrieve the navigation targets.

setSemanticAttributes function

This callback function enables you to define a changed semantic attributes map. Signatures: setSemanticAttributes(oSemanticAttributesMap) Parameter:

  • {object} oSemanticAttributesMap New map containing the semantic attributes
  • {string} sSemanticObject Semantic Object for which the oSemanticAttributesMap belongs

setAppStateKey function

This callback function sets an application state key that is used over the cross-application navigation. Signatures: setAppStateKey(sAppStateKey) Parameter:

  • {string} sAppStateKey

originalId string

The ID of the SmartLink control.

open function

This callback function triggers the retrieval of navigation targets and leads to the opening of the navigation popover. Signatures: open() If the beforePopoverOpens has been registered, the open function has to be called manually in order to open the navigation popover.

fireInnerNavigate

Fires event innerNavigate to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

text string

The UI text shown in the clicked link.

href string

The navigation target of the clicked link.

semanticObject string

The semantic object used to retrieve this target.

semanticAttributes object

Map containing the semantic attributes used to retrieve this target.

originalId string

The ID of the SmartLink control.

fireNavigationTargetsObtained

Fires event navigationTargetsObtained to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

mainNavigation sap.ui.comp.navpopover.LinkData

The main navigation object.

actions sap.ui.comp.navpopover.LinkData[]

Array of available navigation target objects.

ownNavigation sap.ui.comp.navpopover.LinkData

The navigation object for the own application. This navigation option is by default not visible on the popover.

popoverForms sap.ui.layout.form.SimpleForm[]

Array containing contact data.

semanticObject string

The semantic object for which the navigation targets have been retrieved.

semanticAttributes object

Map containing the semantic attributes.

originalId string

The ID of the SmartLink control.

show function

This callback function shows the actual navigation popover. If the navigationTargetsObtained has been registered, the show function has to be called manually in order to open the navigation popover. Signatures: show()

  • show(oMainNavigation, aAvailableActions, oAdditionalContent) Parameters:
    • {sap.ui.comp.navpopover.LinkData | null | undefined} oMainNavigation The main navigation object. With null the main navigation object will be removed. With undefined the old object will remain.
    • {sap.ui.comp.navpopover.LinkData[] | [] | undefined} aAvailableActions Array containing the cross application navigation links. With empty array all available links will be removed. With undefined the old links will remain.
    • {sap.ui.core.Control | null | undefined} oAdditionalContent Control that will be displayed in extra content section on the popover. With null the main extra content object will be removed. With undefined the old object still remains.
  • show(sMainNavigationId, oMainNavigation, aAvailableActions, oAdditionalContent) Parameters:
    • {string | undefined} sMainNavigationId The visible description for the main navigation link. With '', both the description and subtitle will be removed. With undefined, the description is calculated using the binding context of a given source object (for example SmartLink control).
    • {sap.ui.comp.navpopover.LinkData | null | undefined} oMainNavigation The main navigation object. With null the main navigation object will be removed. With undefined the old object will remain.
    • {sap.ui.comp.navpopover.LinkData[] | [] | undefined} aAvailableActions Array containing the cross application navigation links. With empty array all available links will be removed. With undefined the old links will remain.
    • {sap.ui.core.Control | null | undefined} oAdditionalContent Control that will be displayed in extra content section on the popover. With null the main extra content object will be removed. With undefined the old object still remains.

getAdditionalSemanticObjects

Gets current value of property additionalSemanticObjects.

Semantic object names which can be used additional to the default semanticObject property in order to get navigation targets links.

Default value is [].

getBeforeNavigationCallback

Gets current value of property beforeNavigationCallback.

Function that is called before the actual navigation happens. This function has to return a promise resolving into a Boolean value for which the navigation will wait. If the Boolean value is true, the navigation will be processed. The beforeNavigationCallback(oNavigationInfo) parameter contains the following data:

getContactAnnotationPath

Gets current value of property contactAnnotationPath.

Navigation property that points from the current to the related entity type where the com.sap.vocabularies.Communication.v1.Contact annotation is defined, for example, 'to_Supplier'. An empty string means that the related entity type is the current one.

Default value is undefined.

getCreateControlCallback

Gets current value of property createControlCallback.

Function that enables the SmartLink control to create an alternative control, which is displayed if no navigation targets are available. The function has no parameters and has to return an instance of sap.ui.core.Control.

getEnableAvailableActionsPersonalization

Gets current value of property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control.

Default value is true.

getFieldName

Gets current value of property fieldName.

The metadata field name for this SmartLink control.

getForceLinkRendering

Gets current value of property forceLinkRendering.

If set to true, the SmartLink control is rendered as a link even if contactAnnotationPath is not set and navigation targets do not exist. Setting this property to true allows the application, for example, to modify the SmartLink control in the event handler, after the user has clicked on a link and the registered event handler has been called.

Note: The ignoreLinkRendering property and the ignoredFields property of the associated SemanticObjectController take precedence over forceLinkRendering.

Default value is false.

getIgnoreLinkRendering

Gets current value of property ignoreLinkRendering.

If set to true, the SmartLink control will render the innerControl or the control provided by createControlCallback instead of the actual link. This is used for example by the SemanticObjectController if this SmartLink is listed in its ignoredFields or no navigation targets were found during prefetch.

Default value is false.

getInnerControl

Gets content of aggregation innerControl.

Control that is displayed instead of SmartLink control, if the SmartLink is disabled (for example, if no navigation targets are available). If innerControl is not provided, the SmartLink control tries to create one with property createControlCallback.

getInnerControlValue

Gets the inner control's value, if no inner control is available, the text of SmartLink control will be returned.

getMapFieldToSemanticObject

Gets current value of property mapFieldToSemanticObject.

If set to false, the SmartLink control will not replace its field name with the according semanticObject property during the calculation of the semantic attributes. This enables the usage of several SmartLink controls on the same semantic object.

Default value is true.

sap.ui.comp.navpopover.SmartLink.getMetadata

Returns a metadata object for class sap.ui.comp.navpopover.SmartLink.

getSemanticObject

Gets current value of property semanticObject.

Name of semantic object which is used to fill the navigation popover. Note: Setting a value triggers an asynchronous determination, so the effect can be delayed.

getSemanticObjectController

Gets current value of property semanticObjectController.

The semantic object controller controls events for several SmartLink controls. If the controller is not set manually, it tries to find a SemanticObjectController in its parent hierarchy.

getSemanticObjectLabel

Gets current value of property semanticObjectLabel.

Shown label of semantic object.

Since 1.40.0 Title section with <code>semanticObjectLabel</code> has been removed due to new UI design

getUom

Gets current value of property uom.

Additionally to the text property the Unit of Measure can be displayed.

Default value is undefined.

setAdditionalSemanticObjects

Sets a new value for property additionalSemanticObjects.

Semantic object names which can be used additional to the default semanticObject property in order to get navigation targets links.

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

Default value is [].

Param Type DefaultValue Description
sAdditionalSemanticObjects string[] []

New value for property additionalSemanticObjects

setContactAnnotationPath

Sets a new value for property contactAnnotationPath.

Navigation property that points from the current to the related entity type where the com.sap.vocabularies.Communication.v1.Contact annotation is defined, for example, 'to_Supplier'. An empty string means that the related entity type is the current one.

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

Default value is undefined.

Param Type DefaultValue Description
sContactAnnotationPath string

New value for property contactAnnotationPath

setCreateControlCallback

Sets a new value for property createControlCallback.

Function that enables the SmartLink control to create an alternative control, which is displayed if no navigation targets are available. The function has no parameters and has to return an instance of sap.ui.core.Control.

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

Param Type DefaultValue Description
oCreateControlCallback object

New value for property createControlCallback

setEnableAvailableActionsPersonalization

Sets a new value for property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control.

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
bEnableAvailableActionsPersonalization boolean true

New value for property enableAvailableActionsPersonalization

setFieldName

Sets a new value for property fieldName.

The metadata field name for this SmartLink control.

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

Param Type DefaultValue Description
sFieldName string

New value for property fieldName

setForceLinkRendering

Sets a new value for property forceLinkRendering.

If set to true, the SmartLink control is rendered as a link even if contactAnnotationPath is not set and navigation targets do not exist. Setting this property to true allows the application, for example, to modify the SmartLink control in the event handler, after the user has clicked on a link and the registered event handler has been called.

Note: The ignoreLinkRendering property and the ignoredFields property of the associated SemanticObjectController take precedence over forceLinkRendering.

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

Default value is false.

Param Type DefaultValue Description
bForceLinkRendering boolean false

New value for property forceLinkRendering

setIgnoreLinkRendering

Sets a new value for property ignoreLinkRendering.

If set to true, the SmartLink control will render the innerControl or the control provided by createControlCallback instead of the actual link. This is used for example by the SemanticObjectController if this SmartLink is listed in its ignoredFields or no navigation targets were found during prefetch.

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

Default value is false.

Param Type DefaultValue Description
bIgnoreLinkRendering boolean false

New value for property ignoreLinkRendering

setInnerControl

Sets the aggregated innerControl.

Param Type DefaultValue Description
oInnerControl sap.ui.core.Control

The innerControl to set

setMapFieldToSemanticObject

Sets a new value for property mapFieldToSemanticObject.

If set to false, the SmartLink control will not replace its field name with the according semanticObject property during the calculation of the semantic attributes. This enables the usage of several SmartLink controls on the same semantic object.

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
bMapFieldToSemanticObject boolean true

New value for property mapFieldToSemanticObject

setSemanticObject

Sets a new value for property semanticObject.

Name of semantic object which is used to fill the navigation popover. Note: Setting a value triggers an asynchronous determination, so the effect can be delayed.

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

Param Type DefaultValue Description
sSemanticObject string

New value for property semanticObject

setSemanticObjectController

Sets a new value for property semanticObjectController.

The semantic object controller controls events for several SmartLink controls. If the controller is not set manually, it tries to find a SemanticObjectController in its parent hierarchy.

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

Param Type DefaultValue Description
oSemanticObjectController any

New value for property semanticObjectController

setSemanticObjectLabel

Sets a new value for property semanticObjectLabel.

Shown label of semantic object.

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

Since 1.40.0 Title section with <code>semanticObjectLabel</code> has been removed due to new UI design
Param Type DefaultValue Description
sSemanticObjectLabel string

New value for property semanticObjectLabel

setUom

Sets a new value for property uom.

Additionally to the text property the Unit of Measure can be displayed.

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

Default value is undefined.

Param Type DefaultValue Description
sUom string

New value for property uom