class sap.ui.comp.navpopover.SemanticObjectController

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/navpopover/SemanticObjectController
Application Component: CA-UI5-CMP

The SemanticObjectController control operates as a single entry point for SmartLink controls created automatically by SmartTable control, SmartChart control, SmartForm control and SmartField control based on OData metadata. Additionally, all events provided by the SmartLink control are registered by the SemanticObjectController and can be consumed there in a single place. As usual, the SemanticObjectController can be defined within the XML view as well as in the code.


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.SemanticObjectController(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
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
contactAnnotationPaths object

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, '\{"Supplier":"to_Supplier", "CompanyName":"to_Company"\}' . An empty string means that the related entity type is the current one.

Since: 1.40.0.

Visibility: public
enableAvailableActionsPersonalization object

Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}' .

Since: 1.44.0.

Visibility: public
entitySet string

The name of the entity set used. If entitySet has not been defined, the SemanticObjectController tries to retrieve the name from its parents. Note: This is not a dynamic UI5 property.

Since: 1.28.0.

Visibility: public
fieldSemanticObjectMap object

Maps the fields to the related semantic objects. When accessing this property for the first time, the mapping will be calculated from the metadata within the provided model.

Since: 1.28.0.

Visibility: public
forceLinkRendering object

Object containing fields for which the corresponding SmartLink control is rendered as a link even if contactAnnotationPaths 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.\n

Note: The ignoredFields property and the ignoreLinkRendering property of the SmartLink control take precedence over forceLinkRendering.\n

Example of usage: '\{"Supplier":"true", "CompanyName":"true"\}'

Since: 1.58.0.

Visibility: public
ignoredFields string

Comma-separated list of fields that must not be displayed as links.

Since: 1.28.0.

Visibility: public
mapFieldToSemanticObject boolean

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.

Since: 1.48.0.

Visibility: public
prefetchNavigationTargets boolean false

If set to true, the SemanticObjectController will retrieve all navigation targets once and will disable links for which no targets were found. Setting this value to true will trigger an additional roundtrip.

Since: 1.28.0.

Visibility: public

Events Overview

Event Description
beforePopoverOpens

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

Since: 1.28.0.

navigate

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 have been retrieved, navigationTargetsObtained is fired and makes it possible you to change the targets.

Since: 1.28.0.

prefetchDone

If the property prefetchNavigationTargets is set to true, event prefetchDone is fired after all navigation targets have been retrieved.

Since: 1.28.0.

beforePopoverOpens

Event is fired before the navigation popover opens and before navigation target links are retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink, 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 control that fires this event. If beforePopoverOpens is registered on the SmartLink, originalId is the same as the event's source ID which is also the SmartLink's ID. If the beforePopoverOpens is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

open function

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

navigate

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 control that fires this event. If navigate is registered on the SmartLink, originalId is the same as the event's source ID which is the SmartLink's ID. If navigate is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

navigationTargetsObtained

After the navigation targets have been retrieved, navigationTargetsObtained is fired and makes it possible you 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 control that fires this event. If navigationTargetsObtained is registered on the SmartLink, originalId is the same as the event's source ID which is also the SmartLink's ID. If navigationTargetsObtained is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

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.

prefetchDone

If the property prefetchNavigationTargets is set to true, event prefetchDone is fired after all navigation targets have been retrieved.

Since: 1.28.0.

The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
semanticObjects object

A map containing all semantic objects as keys for which at least one navigation target has been found. The value for each semantic object key is an array containing the available actions found for this semantic object.


Methods Overview

Method Description
attachBeforePopoverOpens

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

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

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

attachNavigate

Attaches event handler fnFunction to the navigate event of this sap.ui.comp.navpopover.SemanticObjectController.

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.SemanticObjectController 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.SemanticObjectController.

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

After the navigation targets have been retrieved, navigationTargetsObtained is fired and makes it possible you to change the targets.

attachPrefetchDone

Attaches event handler fnFunction to the prefetchDone event of this sap.ui.comp.navpopover.SemanticObjectController.

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

If the property prefetchNavigationTargets is set to true, event prefetchDone is fired after all navigation targets have been retrieved.

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
detachBeforePopoverOpens

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

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

detachNavigate

Detaches event handler fnFunction from the navigate event of this sap.ui.comp.navpopover.SemanticObjectController.

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.SemanticObjectController.

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

detachPrefetchDone

Detaches event handler fnFunction from the prefetchDone event of this sap.ui.comp.navpopover.SemanticObjectController.

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

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
sap.ui.comp.navpopover.SemanticObjectController.extend

Creates a new subclass of class sap.ui.comp.navpopover.SemanticObjectController 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.Element.extend.

fireBeforePopoverOpens

Fires event beforePopoverOpens to attached listeners.

fireNavigate

Fires event navigate to attached listeners.

fireNavigationTargetsObtained

Fires event navigationTargetsObtained to attached listeners.

firePrefetchDone

Fires event prefetchDone to attached listeners.

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
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

getContactAnnotationPaths

Gets current value of property contactAnnotationPaths.

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, '\{"Supplier":"to_Supplier", "CompanyName":"to_Company"\}' . An empty string means that the related entity type is the current one.

getEnableAvailableActionsPersonalization

Gets current value of property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}' .

getEntitySet

Gets current value of property entitySet.

The name of the entity set used. If entitySet has not been defined, the SemanticObjectController tries to retrieve the name from its parents. Note: This is not a dynamic UI5 property.

getFieldSemanticObjectMap

Gets current value of property fieldSemanticObjectMap.

Maps the fields to the related semantic objects. When accessing this property for the first time, the mapping will be calculated from the metadata within the provided model.

getForceLinkRendering

Gets current value of property forceLinkRendering.

Object containing fields for which the corresponding SmartLink control is rendered as a link even if contactAnnotationPaths 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.\n

Note: The ignoredFields property and the ignoreLinkRendering property of the SmartLink control take precedence over forceLinkRendering.\n

Example of usage: '\{"Supplier":"true", "CompanyName":"true"\}'

getIgnoredFields

Gets current value of property ignoredFields.

Comma-separated list of fields that must not be displayed as links.

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.

sap.ui.comp.navpopover.SemanticObjectController.getMetadata

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

getPrefetchNavigationTargets

Gets current value of property prefetchNavigationTargets.

If set to true, the SemanticObjectController will retrieve all navigation targets once and will disable links for which no targets were found. Setting this value to true will trigger an additional roundtrip.

Default value is false.

Since 1.42.0 The property <code>prefetchNavigationTargets</code> is obsolete as navigation targets are determined automatically. The SmartLink controls are re-rendered as soon as the asynchronous determination of navigation targets has been completed.
hasSemanticObjectLinks

Checks if the given semantic object name has a navigation link. Note: this method returns a valid value only after the event prefetchDone has been raised. The event prefetchDone is raised if the property prefetchNavigationTargets is set to true.

Since 1.42.0 The method <code>hasSemanticObjectLinks</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
isControlRegistered

Returns whether the given control has been registered by the SemanticObjectController.

registerControl

Adds the given control to the SemanticObjectController and registers all relevant events.

setBeforeNavigationCallback

Sets a new value for 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

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

setContactAnnotationPaths

Sets a new value for property contactAnnotationPaths.

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, '\{"Supplier":"to_Supplier", "CompanyName":"to_Company"\}' . 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.

setEnableAvailableActionsPersonalization

Sets a new value for property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}' .

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

setEntitySet

Sets a new value for property entitySet.

The name of the entity set used. If entitySet has not been defined, the SemanticObjectController tries to retrieve the name from its parents. Note: This is not a dynamic UI5 property.

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

setFieldSemanticObjectMap

Sets a new value for property fieldSemanticObjectMap.

Maps the fields to the related semantic objects. When accessing this property for the first time, the mapping will be calculated from the metadata within the provided model.

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.

Object containing fields for which the corresponding SmartLink control is rendered as a link even if contactAnnotationPaths 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.\n

Note: The ignoredFields property and the ignoreLinkRendering property of the SmartLink control take precedence over forceLinkRendering.\n

Example of usage: '\{"Supplier":"true", "CompanyName":"true"\}'

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

setIgnoredFields

Sets a new value for property ignoredFields.

Comma-separated list of fields that must not be displayed as links.

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

setIgnoredState

Checks if the given SmartLink has to be enabled or disabled and sets the state.

Since 1.42.0 The method <code>setIgnoredState</code> is obsolete as SmartLink is processing the internal state on its own.
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.

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

setPrefetchNavigationTargets

Sets a new value for property prefetchNavigationTargets.

If set to true, the SemanticObjectController will retrieve all navigation targets once and will disable links for which no targets were found. Setting this value to true will trigger an additional roundtrip.

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

Default value is false.

Since 1.42.0 The property <code>prefetchNavigationTargets</code> is obsolete as navigation targets are determined automatically. The SmartLink controls are re-rendered as soon as the asynchronous determination of navigation targets has been completed.
unregisterControl

Removes the given control from the SemanticObjectController and unregisters all relevant events.

attachBeforePopoverOpens

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

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

Event is fired before the navigation popover opens and before navigation target links are retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink, 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.SemanticObjectController itself

attachNavigate

Attaches event handler fnFunction to the navigate event of this sap.ui.comp.navpopover.SemanticObjectController.

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

attachNavigationTargetsObtained

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

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

After the navigation targets have been retrieved, navigationTargetsObtained is fired and makes it possible you 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.SemanticObjectController itself

attachPrefetchDone

Attaches event handler fnFunction to the prefetchDone event of this sap.ui.comp.navpopover.SemanticObjectController.

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

If the property prefetchNavigationTargets is set to true, event prefetchDone is fired after all navigation targets have been retrieved.

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
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.SemanticObjectController itself

detachBeforePopoverOpens

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

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

detachNavigate

Detaches event handler fnFunction from the navigate event of this sap.ui.comp.navpopover.SemanticObjectController.

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.SemanticObjectController.

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

detachPrefetchDone

Detaches event handler fnFunction from the prefetchDone event of this sap.ui.comp.navpopover.SemanticObjectController.

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

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
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.SemanticObjectController.extend

Creates a new subclass of class sap.ui.comp.navpopover.SemanticObjectController 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.Element.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 control that fires this event. If beforePopoverOpens is registered on the SmartLink, originalId is the same as the event's source ID which is also the SmartLink's ID. If the beforePopoverOpens is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

open function

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

fireNavigate

Fires event navigate 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 control that fires this event. If navigate is registered on the SmartLink, originalId is the same as the event's source ID which is the SmartLink's ID. If navigate is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

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 control that fires this event. If navigationTargetsObtained is registered on the SmartLink, originalId is the same as the event's source ID which is also the SmartLink's ID. If navigationTargetsObtained is registered on the SemanticObjectController, originalId helps to identify the original SmartLink control which triggered the event.

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.

firePrefetchDone

Fires event prefetchDone to attached listeners.

Since 1.42.0 The event <code>prefetchDone</code> is obsolete because it depends on the property <code>prefetchNavigationTargets</code> which has been deprecated.
Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

semanticObjects object

A map containing all semantic objects as keys for which at least one navigation target has been found. The value for each semantic object key is an array containing the available actions found for this semantic object.

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:

getContactAnnotationPaths

Gets current value of property contactAnnotationPaths.

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, '\{"Supplier":"to_Supplier", "CompanyName":"to_Company"\}' . An empty string means that the related entity type is the current one.

getEnableAvailableActionsPersonalization

Gets current value of property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}' .

getEntitySet

Gets current value of property entitySet.

The name of the entity set used. If entitySet has not been defined, the SemanticObjectController tries to retrieve the name from its parents. Note: This is not a dynamic UI5 property.

getFieldSemanticObjectMap

Gets current value of property fieldSemanticObjectMap.

Maps the fields to the related semantic objects. When accessing this property for the first time, the mapping will be calculated from the metadata within the provided model.

getForceLinkRendering

Gets current value of property forceLinkRendering.

Object containing fields for which the corresponding SmartLink control is rendered as a link even if contactAnnotationPaths 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.\n

Note: The ignoredFields property and the ignoreLinkRendering property of the SmartLink control take precedence over forceLinkRendering.\n

Example of usage: '\{"Supplier":"true", "CompanyName":"true"\}'

getIgnoredFields

Gets current value of property ignoredFields.

Comma-separated list of fields that must not be displayed as links.

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.

sap.ui.comp.navpopover.SemanticObjectController.getMetadata

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

getPrefetchNavigationTargets

Gets current value of property prefetchNavigationTargets.

If set to true, the SemanticObjectController will retrieve all navigation targets once and will disable links for which no targets were found. Setting this value to true will trigger an additional roundtrip.

Default value is false.

Since 1.42.0 The property <code>prefetchNavigationTargets</code> is obsolete as navigation targets are determined automatically. The SmartLink controls are re-rendered as soon as the asynchronous determination of navigation targets has been completed.

isControlRegistered

Returns whether the given control has been registered by the SemanticObjectController.

Param Type DefaultValue Description
oControl sap.ui.comp.navpopover.SmartLink sap.ui.comp.navpopover.NavigationPopoverHandler

Control registered by SemanticObjectController

registerControl

Adds the given control to the SemanticObjectController and registers all relevant events.

Param Type DefaultValue Description
oControl sap.ui.comp.navpopover.SmartLink sap.ui.comp.navpopover.NavigationPopoverHandler

Control to be registered by SemanticObjectController

setBeforeNavigationCallback

Sets a new value for 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:

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

Param Type DefaultValue Description
fnBeforeNavigationCallback function

New value for property beforeNavigationCallback

setContactAnnotationPaths

Sets a new value for property contactAnnotationPaths.

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, '\{"Supplier":"to_Supplier", "CompanyName":"to_Company"\}' . 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.

Param Type DefaultValue Description
oContactAnnotationPaths object

New value for property contactAnnotationPaths

setEnableAvailableActionsPersonalization

Sets a new value for property enableAvailableActionsPersonalization.

Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}' .

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

Param Type DefaultValue Description
oEnableAvailableActionsPersonalization object

New value for property enableAvailableActionsPersonalization

setEntitySet

Sets a new value for property entitySet.

The name of the entity set used. If entitySet has not been defined, the SemanticObjectController tries to retrieve the name from its parents. Note: This is not a dynamic UI5 property.

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

Param Type DefaultValue Description
sEntitySet string

New value for property entitySet

setFieldSemanticObjectMap

Sets a new value for property fieldSemanticObjectMap.

Maps the fields to the related semantic objects. When accessing this property for the first time, the mapping will be calculated from the metadata within the provided model.

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

Param Type DefaultValue Description
oFieldSemanticObjectMap object

New value for property fieldSemanticObjectMap

setForceLinkRendering

Sets a new value for property forceLinkRendering.

Object containing fields for which the corresponding SmartLink control is rendered as a link even if contactAnnotationPaths 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.\n

Note: The ignoredFields property and the ignoreLinkRendering property of the SmartLink control take precedence over forceLinkRendering.\n

Example of usage: '\{"Supplier":"true", "CompanyName":"true"\}'

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

Param Type DefaultValue Description
oForceLinkRendering object

New value for property forceLinkRendering

setIgnoredFields

Sets a new value for property ignoredFields.

Comma-separated list of fields that must not be displayed as links.

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

Param Type DefaultValue Description
sIgnoredFields string

New value for property ignoredFields

setIgnoredState

Checks if the given SmartLink has to be enabled or disabled and sets the state.

Since 1.42.0 The method <code>setIgnoredState</code> is obsolete as SmartLink is processing the internal state on its own.
Param Type DefaultValue Description
oSmartLink sap.ui.comp.navpopover.SmartLink

the SmartLink which should be enabled or disabled.

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.

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

Param Type DefaultValue Description
bMapFieldToSemanticObject boolean

New value for property mapFieldToSemanticObject

setPrefetchNavigationTargets

Sets a new value for property prefetchNavigationTargets.

If set to true, the SemanticObjectController will retrieve all navigation targets once and will disable links for which no targets were found. Setting this value to true will trigger an additional roundtrip.

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

Default value is false.

Since 1.42.0 The property <code>prefetchNavigationTargets</code> is obsolete as navigation targets are determined automatically. The SmartLink controls are re-rendered as soon as the asynchronous determination of navigation targets has been completed.
Param Type DefaultValue Description
bPrefetchNavigationTargets boolean false

New value for property prefetchNavigationTargets

unregisterControl

Removes the given control from the SemanticObjectController and unregisters all relevant events.

Param Type DefaultValue Description
oControl sap.ui.comp.navpopover.SmartLink sap.ui.comp.navpopover.NavigationPopoverHandler

Control to be unregistered by SemanticObjectController