2 weeks ago
Hi,
I am trying to achieve a navigation scenario from an Object Page in a Fiori Elements app (oData v4) to a List Report page in the same app, keeping some filters from the source page.
If the target page is in a different app this works out of the box using Intent Based Navigation. I can use code like this (see documentation)
oIntentBasedNavigation.navigateOutbound('myOutboundNavigation', { SomeProperty: '1337'});
Which triggers navigation to a URL like this
https://...hana.ondemand.com/site#MyObject-MyAction?SomeProperty=1337
If the target app is a "List Report Object Plan" floorplan, and the target entity has a field named "SomeProperty", the list is filtered by the given value (or if that happens to be the full key, it navigates to the ObjectPage) - as expected.
Now, I want to achieve the same result within an app. From an event handler somewhere in the app I can do like that
this.getRouting().navigateToRoute('MyObjectList', {
'?query': {
SomeProperty: '1337',
}
})
Which triggers navigation to the desired route, looking like this
{"sap.ui5": {
...
"routing": {
"routes": [
{
"pattern": ":?query:",
"name": "MyObjectList",
"target": "MyObjectList"
},
...
}
But the url is different (the query parameters now go into the routing part of the hash), like this
https://...hana.ondemand.com/site#MyObject-MyAction&/?SomeProperty=1337
The list report page loads, but it does not pick up the filter. If I manually remove the "&/" part, it becomes an Intent-navigation and the filter gets set, but that also triggers a reload of the whole app.
What is the proper way to achieve this navigation scenario? I have also been trying:
To put the scenario in a little context, we are using a "Custom Root View" which loads a ToolPage around the FE pages. The tool page provides navigation to different ListReport pages in the app and I need this navigation pattern to move from one object to a list of related objects.
Hoping somebody can provide input on the proper approach, thanks in advance!
//Carl
User | Count |
---|---|
83 | |
11 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.