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.
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 |
Name | Type | Default Value | Description |
---|---|---|---|
additionalSemanticObjects | string[] | Semantic object names which can be used additional to the default |
|
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
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, |
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. |
|
enableAvailableActionsPersonalization | boolean | true | Determines whether the personalization link is shown inside the NavigationPopover control. |
fieldName | string | The metadata field name for this SmartLink control. |
|
forceLinkRendering | boolean | false | If set to true, the Note: The |
ignoreLinkRendering | boolean | false | If set to |
mapFieldToSemanticObject | boolean | true | If set to |
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. |
|
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. |
|
semanticObjectLabel | string | Shown label of semantic object. |
|
uom | string | undefined | Additionally to the |
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 |
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 |
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. |
navigationTargetsObtained |
After the navigation targets are retrieved, |
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. |
setSemanticAttributes | function |
This callback function enables you to define a changed semantic attributes map. Signatures:
|
setAppStateKey | function |
This callback function sets an application state key that is used over the cross-application navigation. Signatures:
|
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: |
Method | Description |
---|---|
attachBeforePopoverOpens |
Attaches event handler When called, the context of the event handler (its 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 |
attachInnerNavigate |
Attaches event handler When called, the context of the event handler (its 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 When called, the context of the event handler (its After the navigation targets are retrieved, |
destroyInnerControl |
Destroys the innerControl in the aggregation innerControl. |
detachBeforePopoverOpens |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachInnerNavigate |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachNavigationTargetsObtained |
Detaches event handler 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
|
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 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
|
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, Default value is |
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 |
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 Note: The Default value is |
getIgnoreLinkRendering |
Gets current value of property ignoreLinkRendering. If set to Default value is |
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 |
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 Default value is |
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 Default value is |
setAdditionalSemanticObjects |
Sets a new value for property additionalSemanticObjects. Semantic object names which can be used additional to the default When called with a value of 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, When called with a value of Default value is |
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 |
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 Default value is |
setFieldName |
Sets a new value for property fieldName. The metadata field name for this SmartLink control. When called with a value of |
setForceLinkRendering |
Sets a new value for property forceLinkRendering. If set to true, the Note: The When called with a value of Default value is |
setIgnoreLinkRendering |
Sets a new value for property ignoreLinkRendering. If set to When called with a value of Default value is |
setInnerControl |
Sets the aggregated innerControl. |
setMapFieldToSemanticObject |
Sets a new value for property mapFieldToSemanticObject. If set to When called with a value of Default value is |
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 |
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 |
setSemanticObjectLabel |
Sets a new value for property semanticObjectLabel. Shown label of semantic object. When called with a value of
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 When called with a value of Default value is |
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 |
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 |
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:
|
|
setAppStateKey | function |
This callback function sets an application state key that is used over the cross-application navigation. Signatures:
|
|
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: |
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 []
.
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
.
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.
Gets current value of property enableAvailableActionsPersonalization.
Determines whether the personalization link is shown inside the NavigationPopover control.
Default value is true
.
Gets current value of property fieldName.
The metadata field name for this SmartLink control.
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
.
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
.
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
.
Gets the inner control's value, if no inner control is available, the text of SmartLink control will be returned.
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
.
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.
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.
Gets current value of property semanticObjectLabel.
Shown label of semantic object.
Gets current value of property uom.
Additionally to the text
property the Unit of Measure can be displayed.
Default value is undefined
.
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Sets the aggregated innerControl.
Param | Type | DefaultValue | Description |
---|---|---|---|
oInnerControl | sap.ui.core.Control |
The innerControl to set |
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 |
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 |
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 |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSemanticObjectLabel | string |
New value for property |
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 |