当我尝试从文件夹“view”加载视图时,出现错误“resource view/View1.view.xml could not be loaded from resources/view/View1.view.xml”。WebIDE 中的文件夹结构如下图所示。
索引.html
<!DOCTYPE HTML>
<html>
<head>
<script id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal" >
</script>
<script>
sap.ui.localResources("webapp");
var app = new sap.m.App("idApp");
var view1 = sap.ui.view({id:"idView1",
viewName:"view.View1",type:sap.ui.core.mvc.ViewType.XML});
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content" ></div>
</body>
</html>
View1.xml
<mvc:View
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc">
<Text id="idbtn" text="Text from" />
</mvc:View>
View1.controller
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("View1");
});
新应用程序.json
{
"routes": [
{
"path": "/webapp/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
}
]
}
我尝试了几种方法,但找不到指向 View1.xml 的方法
在此先感谢,斯里尼。