我想在Eclipse中使用fiori創建一個完整的應用程序。路由和導航應用Fiori - Eclipse
我有一些路由問題。最初我把我的路由器和路徑放在索引裏,在這種情況下我沒有問題。
之後,Sap建議如何分配功能,並且我創建了其他兩個文件:manifest.json和Component.js。 我哪裏錯了? 在先進的感謝
這是我的索引:
<!DOCTYPE HTML>
<html>
<head>
\t <meta http-equiv="X-UA-Compatible" content="IE=edge">
\t <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
\t \t <script src="resources/sap-ui-core.js"
\t \t \t \t id="sap-ui-bootstrap"
\t \t \t \t data-sap-ui-libs="sap.m"
\t \t \t \t data-sap-ui-theme="sap_bluecrystal"
\t \t \t \t data-sap-ui-compatVersion="edge"
\t \t \t \t data-sap-ui-preload="async"
\t \t \t \t data-sap-ui-resourceroots='{
\t \t \t \t "Routing": "./" }'>
\t \t </script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
\t \t <script>
\t \t sap.ui.getCore().attachInit(function(){
\t \t \t new sap.m.Shell({
\t \t \t \t app: new sap.ui.core.ComponentContainer({
\t \t \t \t \t height : "100%",
\t \t \t \t \t name : "Routing"
\t \t \t })
\t \t }).placeAt("content");
\t \t }); \t \t \t \t \t
\t \t </script>
\t </head>
\t <body class="sapUiBody" role="application">
\t \t <div id="content"></div>
\t </body>
</html>
這是組件:
sap.ui.define([
\t "sap/ui/core/UIComponent"
], function (UIComponent) {
\t "use strict";
\t return UIComponent.extend("Routing.Component", {
\t \t metadata: {
\t \t \t manifest: "json"
\t \t },
\t \t init: function() {
\t \t \t // call the init function of the parent
\t \t \t UIComponent.prototype.init.apply(this, arguments);
\t \t \t // router.register("appRouter");
\t \t \t // create the views based on the url/hash
\t \t \t this.getRouter().initialize();
\t \t }
\t });
});
這是清單:
{
\t "_version": "1.1.0",
\t "sap.app": {
\t \t "_version": "1.1.0",
\t \t "id": "Routing",
\t \t "type": "application",
\t \t "i18n": "i18n/i18n.properties",
\t \t "title": "{{routingnavigation2}}",
\t \t "description": "{{appDescription}}",
\t \t "applicationVersion": {
\t \t \t "version": "1.0.0"
\t \t }
\t },
\t "sap.ui": {
\t \t "_version": "1.1.0",
\t \t "technology": "UI5",
\t \t "deviceTypes": {
\t \t \t "desktop": true,
\t \t \t "tablet": true,
\t \t \t "phone": true
\t \t },
\t \t "supportedThemes": ["sap_bluecrystal"]
\t },
\t "sap.ui5": {
\t \t "_version": "1.1.0",
\t \t "rootView": {
\t \t "viewName": "Routing.view.main",
\t \t "type": "XML"
\t \t # "id": "home"
\t \t },
\t \t "dependencies": {
\t \t \t "minUI5Version": "1.30",
\t \t \t "libs": {
\t \t \t \t "sap.ui.core": {},
\t \t \t \t "sap.m": {},
\t \t \t \t "sap.ui.layout": {},
\t \t \t \t "sap.ushell": {}
\t \t \t }
\t \t },
\t \t "contentDensities": {
\t \t \t "compact": true,
\t \t \t "cozy": true
\t \t },
\t \t "models": {
\t \t "i18n": {
\t \t \t "type": "sap.ui.model.resource.ResourceModel",
\t \t \t "settings": {
\t \t \t \t "bundleName": "Routing.i18n.i18n.properties"
\t \t \t \t }
\t \t \t }
\t \t },
\t \t "routing": {
\t \t \t "config": {
\t \t \t "RouterClass": "sap.m.routing.Router",
\t \t \t "viewType": "XML",
\t \t \t "viewPath": "Routing.routingnavigation.view",
\t \t \t \t "controlId": "app",
\t \t \t \t "targetAggregation": "pages"
\t \t \t },
\t \t \t "routes": [{
\t \t \t \t "pattern": "",
\t \t \t \t "name": "view1",
\t \t \t \t "viewName" : "view.view1",
\t \t \t \t "targetAggregation": "pages"
\t \t \t },
\t \t \t {
\t \t \t "pattern": "view2",
\t \t \t \t "name": "view2",
\t \t \t \t "viewName" : "view.view2",
\t \t \t \t "targetAggregation": "pages"
\t \t \t }]
\t \t },
\t }
}
這是錯誤的圖像:
這是結構的圖像: enter image description here
1) 在錯誤消息它說,它無法找到manifest.json的: 「無法加載組件從‘路由/ manifest.json的’...檢查清單‘未找到文件’......「 如何Eclipse中的文件結構看起來像? manifest.json位於何處? 2) 也許下面的鏈接幫助:第4步:[XML Views](https://sapui5.hana.ondemand.com/#docs/guide/1409791afe4747319a3b23a1e2fc7064.html) –
嗨,謝謝你的回覆。清單錯誤,是我的錯,試圖找到我犯另一個錯誤。 我解決不了的錯誤是 遺漏的類型錯誤:無法讀取屬性「初始化」的不確定 – Mavhart
在你的manifest.json它說:「RoutingClass」:「sap.m.routing.Routing」, 會發生什麼,如果你試試: 「routerClass」:「sap.m.routing.Router」,? –