如何在自定义应用程序中使用后退按钮访问Fiori启动板

How to get to Fiori Launchpad with back button in custom App?

本文关键字:按钮 访问 Fiori 启动 自定义 应用程序      更新时间:2023-09-26

我无法在我的自定义类似 Fiori 的应用程序中获得后退按钮工作。我已将我的应用程序添加到Fiori Launchpad,并在新闻发布会上尝试了以下代码:

var oCrossAppNavigator = sap.ushell.Container
            .getService("CrossApplicationNavigation");
    oCrossAppNavigator.toExternal({
        target : {
            semanticObject : "#"
        }
    });

这对我不起作用。我知道有一个主页按钮,但我希望我的应用程序像标准的Fiori应用程序一样运行。

以下代码有效,但对我来说感觉像是某种肮脏的黑客:

window.history.go(-1);

安装的 UI5 版本是 1.28.8

感谢您的帮助! :)

您可以使用 shellHash 属性而不是 semanticObject 来使其工作:

sap.ushell.Container.getService("CrossApplicationNavigation").toExternal({
    target: {
        shellHash: "#"
    }
});