使用 SAP Web IDE,我从 Master/Detail 模板创建了一个新应用程序。该应用程序使用最初创建的视图。现在我正在尝试添加另一个名为“FileDetail”的视图以加载到详细信息窗口中。我已将视图添加到路线:
routing: {
config: {
routerClass: FileUtility.MyRouter,
viewType: "XML",
viewPath: "FileUtility.view",
targetAggregation: "detailPages",
clearTarget: false
},
routes: [
{
pattern: "",
name: "main",
view: "Master",
targetAggregation: "masterPages",
targetControl: "idAppControl",
subroutes: [
{
pattern: "{file}",
name: "fileDetail",
view: "FileDetail"
},
{
pattern: "{entity}/:tab:",
name: "detail",
view: "Detail",
subroutes: [
]
}
]
},
{
name: "catchallMaster",
view: "Master",
targetAggregation: "masterPages",
targetControl: "idAppControl",
subroutes: [
{
pattern: ":all*:",
name: "catchallDetail",
view: "NotFound",
transition: "show"
}
]
}
]
}
(我知道这是不对的,但我只是想强制它加载页面)当我使用函数时
onFileSelect: function(oEvent) {
this.getRouter().navTo("fileDetail", {
from : "detail",
file: oEvent.getSource().getBindingContext().getPath().slice(1)
}, true);
},
被调用我在 JS 控制台中得到一个错误
Uncaught Error: failed to load 'view/FileDetail.controller.js' from resources/view/FileDetail.controller.js: 404 - Resource could not be found!
我添加的唯一文件是 FileDetail.controller.js 和 FileDetail.view.xml,它们是使用新视图向导添加的
谢谢你的帮助!