简体   繁体   中英

How to navigate from launchpad to Fiori apps and then back?

In our company, we've set up the Fiori launchpad, in it we have configured a tile that is linked to a customly developed SAPUI5 app, which is deployed as a BSP on the server. It took us a long while, yet using the router pattern within that application, we managed to make the navigation from the Launchpad tile to the custom UI5 application work.

The thing we are struggling with, however, are these 2 other navigation paths:

  • From the application back to the Fiori launchpad (back home)
  • From the application to another application (tile to tile)

Ideally, this out of application navigation is in the UI5 way, including a transition, so not just a window.replace in JS. After a long search, the only hint I've found in support for this scenario is in this class:

https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ushell.services.CrossApplicationNavigation.html

However, I don't understand how to use it. The example isn't even correct and has syntax errors. I've found 2 forum posts elsewhere asking about how to use it, but they lack any meaningful answer.

Assuming you are using Semantic Objects for in-place navigation configured in your Launchpad to navigate to UI5 Applications you can navigate from one Application to another using the CrossApplicationNavigation service you already mentioned. However, the documentation about it is slightly confusing. This is how it works for me:

// Step 1: Get Service for app to app navigation
var navigationService = sap.ushell.Container.getService("CrossApplicationNavigation");

// Step 2: Navigate using your semantic object
navigationService.toExternal({ 
                               target : { semanticObject : "<YourObject>", action: "<YourAction>" },
                               params : { A : "B" } // optionally
                            })

If you want to go back to your launchpad after in-place navigation you simply need to call

window.history.go(-1)

This still triggers the correct transition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM