此問題來自this answer(我無法獲得源代碼的運行),我的要求與this question類似,它是應用程序控制,使用一個主控和一個詳細視圖導航到SplitContainer。 Master.view.xml成功加載,但我得到SAPUI5路由拋出錯誤「無法找到控件(應用程序控件的ID)」
"Control with ID app could not be found"
錯誤,當我單擊項目。
我metadata.json:
"routing": {
"config": {
"routerClass": "cts.alert.MyRouter",
"viewType": "XML",
"viewPath": "cts.alert.view",
"controlId": "app",
"controlAggregation": "pages",
"clearTarget": "false",
"bypassed": {
"target": [
"notFound"
]
},
"async": true
},
"routes": [
{
"pattern": "",
"name": "worklist",
"target": [
"worklist"
]
},
{
"pattern": "split",
"name": "split",
//<SplitContainer id="idAppControl"> in SplitApp.view.xml
"view": "SplitApp",
//<App id="app"/> in App.view.xml
"targetControl": "app",
"subroutes": [
{
"pattern": "master",
"name": "main",
"view": "Master",
"targetAggregation": "masterPages",
"targetControl": "idAppControl", //SplitContainer id
"subroutes": [
{
"pattern": "VEHICLES/{objectId}",
"name": "object",
"view": "Detail",
"targetAggregation": "detailPages",
}
]
}
]
},
{
"name": "catchallMaster",
"view": "Master",
"targetAggregation": "masterPages",
"targetControl": "idAppControl",
"subroutes": [
{
"pattern": ":all*:",
"name": "catchallDetail",
"view": "NotFound"
}
]
}
],
"targets": {
"master": {
"viewName": "Master",
"viewLevel": 2,
"viewId": "master",
"controlAggregation": "masterPages"
},
"worklist": {
"viewName": "Worklist",
"viewId": "worklist",
"viewLevel": 1
},
"object": {
"viewName": "Detail",
"viewId": "detail",
"viewLevel": 3
},
"objectNotFound": {
"viewName": "ObjectNotFound",
"viewId": "objectNotFound"
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound"
},
"detailObjectNotFound": {
"viewName": "DetailObjectNotFound",
"viewId": "detailObjectNotFound"
},
"detailNoObjectsAvailable": {
"viewName": "DetailNoObjectsAvailable",
"viewId": "detailNoObjectsAvailable"
}
}
}
}
我不知道,如果子路徑還需要這麼多的目標。我知道問題出在"targetControl" : "app"
在"split"
路線,但如果我添加 「targetControl」:在"object"
路線 「idAppControl」,它也將產生
Control with ID idAppControl could not be found
和this answer說:
You can't join the same control as your parent route has.
我我現在真的很困惑。
而且我也試過刪除"rootview"
在"sap.ui5"
,不工作。
任何幫助將受到歡迎!提前致謝!