cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use a # router parameter for a UI5 app in the Fiori Launchpad?

MattHarding
Active Contributor
0 Kudos

Hi All,

I've integrated a custom UI5 app via lpd_cust and semantic objects which works fine, but I have a requirement to pass through some routing information to the URL and can't figure out where to put it within the configuration.

For example, if the Launchpad URL looked like this:

https://<url:port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/Fiorilaunchpad.html#<Semantic Object>-<Action>

I need to actually pass it the following (which works if I manually add it:

https://<url:port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/Fiorilaunchpad.html#<Semantic Object>-<Action>&/<route>

Or to ask this in a different way, I have a UI5 app that I need to start like this:

https://<url:port>/sap/bc/ui5_ui5/sap/<ui5 app>/index.html?#<route>

How can I represent the <route> within the semantic object configuration?

Thanks,

Matt

Accepted Solutions (1)

Accepted Solutions (1)

former_member182048
Active Contributor
0 Kudos

Matt,

I had a similar requirement - same UI5 component used by different organizations and different roles, depending on the role or organization there would be different terminologies or steps for the business process etc. The code was the same, just presented differently.

I tried to affect the routing via LPD_CUST, this normally works for NWBC and Portal, but doesn't for FLP. I tried to add a param in the tile config, no luck either.  I ended up using different semantic actions, then based on the actions set up the initial state relevant to the org and role.

inside my Component->init I have something similar the following code


      if (!this.sAppName)

            //<semantic obj>-display<appName>

            if (sap.ushell) {   //1

                var relevantHash = sap.ushell.utils.getBasicHash(window.location.hash);  //2

                this.sAppName = relevantHash.match(/-display(\w+)/)[1].toUpperCase();

1. determine if run in FLP

2. get sAppName from the hash

from there i can call the correct routing <not exactly what i do but you can get the idea>


switch(this.sAppName)

{

case 'foo':

this.getRouter()._myNavToWithoutHash("view.WelcomeFoo", "XML", false);

break;

hth

jsp

Answers (1)

Answers (1)

MattHarding
Active Contributor
0 Kudos

Thanks John. I marked this as Correct, as I'm guessing native route support is not going to be there for a while in the Launchpad (at least not until another Support Pack here). 

The other, less reusable option I went with in the end was to use a different component; which in my case is okay since I effectively have 3 apps in 1 app (lots of reuse between views and controllers).  That said, if I get a breather, I might use your sample code above though I would feel a little more supported if there was a method already defined to get the hash.

Thanks yet again,

Matt