cancel
Showing results for 
Search instead for 
Did you mean: 

Intent-based Navigation - semanticObjectAction annotation

RaminS
Active Participant
0 Kudos
314

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.

RaminS_0-1736956274399.png

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:

RaminS_1-1736956358356.png

So why does it not navigate to the intended target instead of bringing up a list of actions?

Thanks

 

Accepted Solutions (0)

Answers (1)

Answers (1)

patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,
try with 

 

type: #WITH_INTENT_BASED_NAVIGATION

 

Regards,
Patrick

RaminS
Active Participant
0 Kudos

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',

RaminS
Active Participant
0 Kudos

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. 

RaminS_0-1737652762585.png

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 !... 😯

 

 

patrick_winkler
Product and Topic Expert
Product and Topic Expert
Hi @RaminS sorry to hear that. At least in my example, I can switch between the popover and direct navigation by changing the type. Best regards, Patrick
RaminS
Active Participant
0 Kudos

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.

RaminS
Active Participant
0 Kudos

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:

RaminS_1-1737724914176.png

RaminS_2-1737724928139.png

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:

RaminS_3-1737725080134.png

 

 

 

 

patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Kudos

hi @RaminS in the second link you can find the following information: https://sapui5.hana.ondemand.com/sdk/#/topic/d782acf8bfd74107ad6a04f0361c5f62.html

Navigation to a Semantic Object (Intent-Based Navigation)

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.

patrick_winkler_0-1737729891619.png

 

 

RaminS
Active Participant
0 Kudos

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

RaminS_0-1737733507035.png

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.