UI5有时会引发错误:找不到ID为...的控件-EventProvider sap.m.routing.Target

问题描述 投票:2回答:1

随机地,SAPUI5引发错误未找到ID为rootControl的控件-EventProvider sap.m.routing.Target登录(SAP NetWeaver)后进入SAPUI5页面。我试图强制错误登录和注销。经过多次尝试(40次有时102次...),发生了错误。

我的根控制是<App id="rootControl">中的App.view.xml

manifest.json

{
    "_version": "1.1.0",
    "sap.app": {
        "_version": "1.1.0",
        "id": "HomePage",
        "type": "application",
        "i18n": "i18n/i18n.properties",
        "title": "{{appTitle}}",
        "description": "{{appDescription}}",
        "applicationVersion": {
            "version": "1.0.6"
        },
        "ach": "CA-UI5-FST"
    },
    "sap.ui": {
        "technology": "UI5",
        "deviceTypes": {
            "desktop": true,
            "tablet": true,
            "phone": true
        }
    },
    "sap.ui5": {
        "rootView": {
            "viewName": "HomePage.view.App",
            "type": "XML",
            "async": true,
            "id": "rootControl"
        },
        "dependencies": {
            "minUI5Version": "1.30",
            "libs": {
                "sap.m": {},
                "sap.ui.core": {}
            }
        },
        "resources": {
            "css": [
                {
                  "uri": "css/customStyle.css"
                }
            ]
        },
        "models": {
            "i18n": {
                "type": "sap.ui.model.resource.ResourceModel",
                "settings": {
                    "bundleName": "HomePage.i18n.i18n"
                }
            },
            "view": {
                "type": "sap.ui.model.json.JSONModel",
                "settings": {
                    "defaultOperationMode": "Server",
                    "defaultBindingMode": "TwoWay",
                    "defaultCountMode": "None",
                    "useBatch": false
                }
            }
        },
        "routing": {
            "config": {
                "routerClass": "sap.m.routing.Router",
                "viewType": "XML",
                "viewPath": "HomePage.view",
                "controlId": "rootControl",
                "controlAggregation": "pages",
                "transition": "slide",
                "bypassed": {
                    "target": "notFound"
                },
                "async": true
            },
            "routes": [{
                "pattern": ":Layout:",
                "name": "apphome",
                "target": "home"
            }, {
                "name": "id",
                "pattern": "Id/{Id}/:Layout:",
                "target": "id"
            }, {
                "name": "details",
                "pattern": "Details/{Details}/:Replace:",
                "target": "details"
            }],
            "targets": {
                "home": {
                    "viewId": "home",
                    "viewName": "Homepage",
                    "viewLevel": 1
                },
                "notFound": {
                    "viewId": "notFound",
                    "viewName": "NotFound",
                    "transition": "show"
                },
                "id": {
                    "viewId": "id",
                    "viewName": "Id",
                    "viewLevel": 2
                },
                "details": {
                    "viewId": "details",
                    "viewName": "Details",
                    "viewLevel": 3
                }
            }
        }
    }
}

任何想法?

sapui5
1个回答
4
投票

随机SAPUI5引发错误...

我记得在以前的UI5版本中由于竞赛条件而遇到相同的问题:

  1. 启动应用程序时,由于Component.jssap.ui5/rootView/async: true异步检索根视图。
  2. init中的Component.js通常会初始化路由器,该路由器将检索与哈希值相对应的目标视图。while根视图仍在加载。
  3. 有时,根视图无法在目标视图之前完全加载,这会导致错误→目标不知道将其视图放置在何处。

commit:d054bc1确保目标等待直到完全加载根视图。该修补程序的发布日期为1.54,但根据更改日志,该修补程序的版本也应为1.52.5+。为了查看应用运行的UI5版本,请按Ctrl + 左Alt + Shift + P。请将UI5库升级到最新的稳定版本。

我愿意不是建议同步加载根视图。

© www.soinside.com 2019 - 2024. All rights reserved.