on 2021 Jan 14 11:51 AM
Dear Fiori Elements Experts,
I developed 2 Fiori elements apps with Fiori elements tools for an OData v2 service built on CAP.
App A is an LROP, where I deleted the OP. App B is an LROP.
My goal is to navigate from app A to B when selecting a row in A, setting a (hidden) property from A as a filter in B.
How should I configure the navigation parameters? Let me summarize my tests.
If I set the following crossNavigation parameters in app A, I get the value as expected:
"outbounds": {
"operation-display": {
"semanticObject" : "operation",
"action" : "display",
"parameters": {
"toWorkCenter_ID": {
"value": {
"value": "blablabla",
"format": "plain"
}
}
}
}
}
Ok, so “toWorkCenter_ID” seems to be the parameter I need to fix.
As mentioned here by expanding sap.app section, I should use format = ‘binding’ and a binding path to my model as value, so I set the following configuration:
"outbounds": {
"operation-display": {
"semanticObject" : "operation",
"action" : "display",
"parameters": {
"toWorkCenter_ID": {
"value": {
"value": "ID",
"format": "binding"
}
}
}
}
}
But I get an unexpected result:
I also tested with format = 'binding' and the following values without getting success:
"value": "{/ID}",
"value": "{ID}",
"value": ">/ID",
"value": "{>/ID}",
"value": "code", //another property
My model is defined like this:
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"defaultBindingMode": "TwoWay",
"defaultCountMode": "Inline",
"refreshAfterChange": false,
"metadataUrlParams": {
"sap-value-list": "none"
}
}
}
Does anyone know how the set up binding here?
Thanks in advance.
Best regards,
Marc
Hey guys, I just solved more or less the same issue.
I have App1 and from its object page I want to navigate to App2(MyProducts). My annotation looked like this:
$Type : 'UI.DataFieldWithIntentBasedNavigation',
Value : product_ID,
Label : '{i18n>product}',
SemanticObject : 'MyProduct',
Action : 'Display'
And it was not working as it was passing wrong ID in order to open the product on App2. It was sending the parrent ID of the object page in App1.
Anyways, after I saw you guys mentioned it is not working as the source property(product_ID in my case) and the target property(ID in my case) should be the same, I did the following:
1. defined a virtual property ID for my projection in my service.cds, so it has the same name(ID) as on target App2
@readonly entity MyEntity as projection on db.MyEntity;
extend projection MyEntity with {
@UI.Hidden @UI.HiddenFilter
null as ID: UUID
}
2. populated it with the product_ID value in my service.js file like:
srv.after('READ', 'MyEntity', async (items, request) => {
for (const item of item) {
item.ID = item.product_ID
}
})
3. and changed the annotation to:
$Type : 'UI.DataFieldWithIntentBasedNavigation',
Value : ID,
Label : '{i18n>product}',
SemanticObject : 'MyProduct',
Action : 'Display'
It works fine now. Still, it's certainly not the right way, but I spent a day figuring out how to get it to work out of the box, so I'll go with this solution for now.
If you managed to get it to work with just the annotation, please share the solution.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.