on 2017 Oct 20 5:41 AM
I have a requirement to have 2 tiles in the launchpad that open the same app, but a different view in this app (2 separate routes). While I could implement a startup URL parameter in the app itself and configure this in each tile, I'm hoping there is a way of taking advantage of the existing routes that are already configured?
Unfortunately, I haven't found an easy way to do this and thought I would ask before falling back to startup URL parameters.
Anyone know if this is possible?
Note - I'm configuring this on an on-premise Fiori Launchpad.
Cheers,
Matt
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
i think you can use the target setting with "shellHash" for your case.
Ex:
var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
oCrossAppNavigator.toExternal({
target: {
shellHash: "{SemanticObject-action}?someParam=abc&/{route-pattern}"
}
});
Hope it helps.
Cheers
Cuong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
may be I did not understand your requirement exactly.
But that worked for me in my project to do the cross app navigation. I could navigate from one Fiori App (Tile) to another one, not within the same App.
Best
Cuong
Hi Cuong,
Apologies if it wasn't clear as I can now see how "tile" can be misinterpreted. What I was referring to was the config for the Tile in the Fiori Launchpad calling a different route. Oddly enough, I've practically asked the same question over 2 years ago (thinking that this should be a standard feature) but there seems to still be no answer that doesn't involve UI5 coding:
https://archive.sap.com/discussions/thread/3697844
In other words, imagine having 2 tiles on the Fiori Launchpad - they both launch the same app, but with different routes.
Anyway, will most likely go with URL parameters since I know that works.
Cheers,
Matt
Hi Matt,
it gets clearer now 🙂
In my project, we almost use the same technique by setting startup parameters.
However, we delegate the route decision logic to the backend.
Correspoding to the startup parameters, the Customer uses SPRO to customize the appropriate XML-View name in the backend. Then, frontend will route to that View received from the oData Service.
By doing that, customers can change or add more Views later on their own by only configurations. They don't need to modify the original UI5 code.
I would be happy to hear new easier approach to your requirement too.
Cheers
Cuong
Hello Matt,
Thanks for your response. After much research, even I am going with parameters defined in target mapping (this has an advantage over passing them from tile that these are not shown in URL) and navigating to route based on these.
However, this approach leads me in some trouble with back navigation as in History object there are two entries now (1st is "" and 2nd is my actual route) and navigating to windows.history.go(-1) leads to the homepage of app instead going back to Fiori launchpad.
Is there anyway we can request this much desired feature to SAP?
Regards,
Ekansh
Answer from Joel works perfectly, just wanted to add - I needed to do this now for static tile and through App Manager. There it doesn't allow to put URL parameters as string but rather as a name value pair. Also the parameter name is mandatory. I tried and this worked - router parses is properly and app lands in the desired view:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
21 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.