Created
March 18, 2019 13:15
-
-
Save Leoooob/d66dc83358e8bf26d68982ec167a9a6b to your computer and use it in GitHub Desktop.
SAPUI5 Fiori cross-app navigation example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add _launchCrossApp() function to the base controller and invoke as below | |
const semanticObject = "MyCustomApp"; | |
const semanticAction = "display"; | |
let mParams = {}; | |
mParams["myParameter"] = "myValue"; | |
this._launchCrossApp(semanticObject, semanticAction, mParams); | |
// the function | |
_launchCrossApp: function _launchCrossApp(semanticObject, semanticAction, mParams) { | |
const oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation"); | |
// generates a hash for the Fiori Launchpad to follow | |
const hash = (oCrossAppNavigator && oCrossAppNavigator.hrefForExternal({ | |
target: { | |
semanticObject: semanticObject, | |
action: semanticAction | |
}, | |
params: mParams | |
})) || ""; | |
// navigates to the new hash | |
oCrossAppNavigator.toExternal({ | |
target: { | |
shellHash: hash | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment