0

我想在我的应用中导航并进行跨应用导航。

在我的 manifest.json 中,我有一个“routerClass”:“sap.m.routing.Router”,当我定义这个类时,我的内部导航工作正常,但应用程序之间的交叉导航不再工作(网址更改,但导航从未发生过 - 我必须刷新才能进入正确的页面)。

如果我更改此类,后退按钮将始终转到第一页而不是访问的最后一页,但交叉导航工作正常。

你可以帮帮我吗 ?

这是我的代码:

清单.json

        "routing": {
            "config": {
                "routerClass": "sap.m.routing.Router",
                "viewType": "XML",
                "viewPath": "JoskinEngineItem.view",
                "controlId": "app",
                "controlAggregation": "pages",
                "transition": "slide",
                "fullWidth": true,
                "clearTarget": false,
                "clearAggregation": false
            },
            "routes": [
                {
                    "pattern": "",
                    "name": "index",
                    "target": "index"
                },
                {
                    "pattern": "indexlevel/{key}",
                    "name": "indexlevel",
                    "target": "indexlevel"
                },
                {
                    "pattern": "search/{key}",
                    "name": "search",
                    "target": "search"
                },
                {
                    "pattern": "class/{key}",
                    "name": "class",
                    "target": "class"
                },
                {
                    "pattern": "production/{key}",
                    "name": "production",
                    "target": "production"
                }
            ],
            "targets": {
                "index": {
                    "viewName": "Index",
                    "viewId": "index",
                    "viewLevel": 1
                },
                "indexlevel": {
                    "viewName": "indexlevel",
                    "viewId": "indexlevel",
                    "viewLevel": 2
                },
                "search": {
                    "viewName": "Search",
                    "viewId": "search",
                    "viewLevel": 5,
                    "transition": "flip"
                },
                "class": {
                    "viewName": "Class",
                    "viewId": "class",
                    "viewLevel": 3
                },
                "production": {
                    "viewName": "Production",
                    "viewId": "production",
                    "viewLevel": 4
                }
            }
        },

跨应用导航

    var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");

    var hash = (oCrossAppNavigator && oCrossAppNavigator.hrefForExternal({
    target: {
    semanticObject: "Link",
    action: "Display"
    }
    })) || "";
    oCrossAppNavigator.toExternal({target: {shellHash: hash}});
4

0 回答 0