a month ago - last edited a month ago
In my FE object page, I want to make a field clickable to navigate to a second app using Intent-Based Navigation.
My CDS view annotations are:
@Consumption.semanticObject: 'AccountingDocument'
@UI.identification: [{
type: #FOR_INTENT_BASED_NAVIGATION,
semanticObjectAction: 'displayDocument',
}]
But when I click on the field, it brings up a list of available action links, one of which is the action that I want.
I don't want to show the user the other links, I want it to navigate directly to the Intent specified by the annotations.
In the browser preview, it shows that the correct annotations are loaded:
So why does it not navigate to the intended target instead of bringing up a list of actions?
Thanks
Request clarification before answering.
Hello,
try with
type: #WITH_INTENT_BASED_NAVIGATION
Regards,
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @patrick_winkler ,
Same results. Still the popover action list comes up, instead of navigating directly to the semantic action defined in the annotation.
Seems like it correctly interprets the annotation for semanticObject but totally ignores the Action
semanticObjectAction: 'displayDocument',
Hi @patrick_winkler ,
Something strange just happened. I switched to #WITH_INTENT_BASED_NAVIGATION in my table's LineItem, and now I'm getting two of the same column. The first column still brings up the popver list, but the second one actually goes to the target action I want.
The strange thing is, the first column has the label that I defined in my annotations but does not respect my semanticAction. The second column that does respect the target, has a different header.
This is my annotation:
@Consumption.semanticObject: 'AccountingDocument'
@UI.lineItem: [
{ position: 99, label: 'Acc Doc' },
{ type: #WITH_INTENT_BASED_NAVIGATION, semanticObjectAction: 'displayDocument'
}]
AccountingDocument;
I have no idea where that second column comes from, if I take out the annotation for AccountingDocument both columns disappear.
Spooky !... 😯
Is there documentation somewhere that describe the CDS annotations and the different options for each one? for example the difference between #WITH_INTENT_BASED_NAVIGATION and #FOR_INTENT_BASED_NAVIGATION? What perhaps what is supported in which version of SAP?
I've looked and can't find anything, SAP's help docs are not useful, they don't explain every option.
Thanks @patrick_winkler for sharing those links.
I had already seen those documents but I didn't find them useful. They don't explain what the behaviour is and what the different attributes of the annotations actually do. Here are FOR_INTENT and WITH_INTENT definitions together:
From that can you tell that one brings up a popover and one links directly? If anything, those definitions cause more confusion, eg. what does the attribute value do? It is never explained.
In the the second link you sent, there is absolutely no mention of semanticObjectAction. The only example we get is this:
hi @RaminS in the second link you can find the following information: https://sapui5.hana.ondemand.com/sdk/#/topic/d782acf8bfd74107ad6a04f0361c5f62.html
in section "Using a Button" you can see that type: #FOR_INTENT_BASED_NAVIGATION is used to render a button
in section "Using a Link" you can see that type: #WITH_INTENT_BASED_NAVIGATION is used to render it as a link and it is supposed to be used with LineItems
You can also find general information about the popover: When a user chooses the link, and only one navigation target is found, direct navigation to the target is triggered. If more than one target is found, the system displays a popover containing some text and links to the targets for the user to choose from
So if you have a LineItem i.e. column in a table and you want to render it as a link you choose #WITH_INTENT_BASED_NAVIGATION. If the combination of semanticObject and action is unique a direct navigation is triggered.
Thanks @patrick_winkler , that is indeed useful.
However my link isn't in a table, it's a field on the Object page. So I'm using UI.Identification which should work the same way as LineItem (although I still don't know what the other attributes are for, like "value").
May target navigation is unique, the combination of AccountingDocument-displayDocument represents a unique intent. It's just not seeing my semanticObjectAction
You mentioned earlier that you can switch between popover and direct link by switching between WITH_INTENT and FOR_INTENT. So I don't know how uniqueness of the target comes into play in that case?
Anyways, I'll try a few other things, hopefully I can get it to work by trial and error.
Thanks for your help.
User | Count |
---|---|
55 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.