Mario
Mario

Reputation: 43

SAP UI5 Cross Application Navigation without FLP

I have two apps. The first app has a view. There I push a button and then it should change to the second application. I don't want to navigate to the first view, but to the second with a parameter.

I use this:

oCrossAppNavigator.toExternal({
    target : {  
               semanticObject : "Z_APP2",
               action : "onPress"
             }, 
    params : {
               param1 : param1
             }

In APP2 I write this in the Component.js:

var oRouter = this.getRouter().initialize();
        var oComponentData = this.getComponentData();
        if (oComponentData.startupParameters) {
            oRouter.navTo("Detail", {
                param1 : oComponentData.startupParameters.param1[0],
            }, false);

It doesn't switch to the other app. Which action should I write here ? Do I have to implement something else in App2?

Upvotes: 1

Views: 3848

Answers (2)

maruha
maruha

Reputation: 11

I have a same issue. SAPUI5 provide sap.m.URLHelper which contains redirect method :

sap.m.URLHelper.redirect(sURL, bNewWindow?)

I think SAPUI5 do the same thing than window.location.replace() but more SAPUI5-friendly.

Upvotes: 0

Mario
Mario

Reputation: 43

The answer is:

window.location.replace("-- url with parameters here --")

The right system is : window.location.host

Upvotes: 1

Related Questions