cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic Intent Based Navigation

RaminS
Active Participant
0 Likes
2,497

I created a List Report with a bunch of columns, one of which uses an Intent-based navigation to one of two external target pages, based on certain conditions.

I need to navigate to a different target page (different semantic object-target) based on the value of the column.

Here's my CDS annotation for one of the two targets:

@Consumption.semanticObject: 'ExpenseCenter'
@UI.lineItem: [{ position: 35, semanticObjectAction: 'manage', type: #WITH_INTENT_BASED_NAVIGATION }]   
@EndUserText.label: 'Source'
    SourceApp;

Let's say if the value is "Expense Center" I want it to link to ExpenseCenter-manage. If the value is "Checkin", it should point to Checkin-manage.

How can I make it point to a different semanticObject and Action based on a certain condition? The annotation @Consumption.semanticObject doesn't seem to accept an element, just a string literal.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

RaminS
Active Participant

After much trial and error, I found out that the method  adaptNavigationParameterExtension can be used in the controller extension to capture the intend-based navigation.

 

RaminS_0-1747163563007.png

 

german_castaneda
Discoverer
0 Likes
Ramin you legend
RaminS
Active Participant
0 Likes

I tried using adaptNavigationParameterExtension( ), but it only lets me add or remove parameters, it does not allow changing Semantic Object and Actions. 

I traced the calling program to the following SAP method onDataFieldWithIntentBasedNavigation in  CommonEventHandlers

RaminS_0-1748618920734.png

Does anyone know how to overwrite this method and change SemanticObject?

I read a similar issue identified by @gregorw here but it doesn't work for us. The semantic object annotation does not take a Path, only a String.

MioYasutake
SAP Champion
SAP Champion
0 Likes

@RaminS 

The following document describes how to dynamically change navigation targets using a controller extension.

https://sapui5.hana.ondemand.com/#/topic/a12ad6058db84e8cb60a3a9b2ade63fb

 

RaminS
Active Participant
0 Likes

Hi @MioYasutake ,

Thanks for your answer. That page describes how to replace the default List-to-Object navigation. My links are intent-based navigation links in a table, not default navigation to the object page. The event onListNavigationExtension does not get fired on intent-based navigation.

 

RaminS_0-1746110954631.png