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.
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 |
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
Since: 1.75.0.Visibility: public |
|
contactAnnotationPaths | object | Navigation property that points from the current to the related entity type where the |
|
enableAvailableActionsPersonalization | object | Determines whether the personalization link is shown inside the NavigationPopover control. For example, |
|
entitySet | string | The name of the entity set used. If |
|
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. |
|
forceLinkRendering | object | Object containing fields for which the corresponding Note: The Example of usage: |
|
ignoredFields | string | Comma-separated list of fields that must not be displayed as links. |
|
mapFieldToSemanticObject | boolean | If set to |
|
prefetchNavigationTargets | boolean | false | If set to |
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, |
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. |
navigationTargetsObtained |
After the navigation targets have been retrieved, |
prefetchDone |
If the property |
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. |
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 control that fires this event. If |
open | function |
This callback function triggers the retrieval of navigation targets and leads to the opening of the navigation popover. Signatures: |
If the property prefetchNavigationTargets
is set to true
, event prefetchDone
is fired after all navigation targets have been retrieved.
Since: 1.28.0.
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. |
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 retrieved. Event can be used to change the parameters used to retrieve the navigation targets. In case of SmartLink, |
attachNavigate |
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 have been retrieved, |
attachPrefetchDone |
Attaches event handler When called, the context of the event handler (its If the property
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 The passed function and listener object must match the ones used for event registration. |
detachNavigate |
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. |
detachPrefetchDone |
Detaches event handler 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
|
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
|
getContactAnnotationPaths |
Gets current value of property contactAnnotationPaths. Navigation property that points from the current to the related entity type where the |
getEnableAvailableActionsPersonalization |
Gets current value of property enableAvailableActionsPersonalization. Determines whether the personalization link is shown inside the NavigationPopover control. For example, |
getEntitySet |
Gets current value of property entitySet. The name of the entity set used. If |
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 Note: The Example of usage: |
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 |
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 Default value is
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
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
When called with a value of |
setContactAnnotationPaths |
Sets a new value for property contactAnnotationPaths. Navigation property that points from the current to the related entity type where the 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. For example, When called with a value of |
setEntitySet |
Sets a new value for property entitySet. The name of the entity set used. If When called with a value of |
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 |
setForceLinkRendering |
Sets a new value for property forceLinkRendering. Object containing fields for which the corresponding Note: The Example of usage: When called with a value of |
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 |
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 When called with a value of |
setPrefetchNavigationTargets |
Sets a new value for property prefetchNavigationTargets. If set to When called with a value of Default value is
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. |
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 |
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.
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.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 |
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.
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 control that fires this event. If |
|
open | function |
This callback function triggers the retrieval of navigation targets and leads to the opening of the navigation popover. Signatures: |
Fires event prefetchDone to attached listeners.
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. |
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.
Gets current value of property enableAvailableActionsPersonalization.
Determines whether the personalization link is shown inside the NavigationPopover control. For example, '\{"Supplier":false, "CompanyName":true\}'
.
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.
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.
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"\}'
Gets current value of property ignoredFields.
Comma-separated list of fields that must not be displayed as links.
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.
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSemanticObject | string |
Name of semantic object |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Checks if the given SmartLink has to be enabled or disabled and sets the state.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSmartLink | sap.ui.comp.navpopover.SmartLink |
the SmartLink which should be enabled or disabled. |
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 |
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 |