on 07-15-2016 6:44 AM
Hello Everybody,
I am getting the following error, while trying to create XML based UI5 application.
My Component.js like below
jQuery.sap.declare("Customer.com.Component");
sap.ui.core.UIComponent.extend("Customer.com.Component", {
metadata : {
manifest: "json"
},
createContent : function() {
// create root view
var oView = sap.ui.view({
id: "idRoot",
viewName: "Customer.com.view.Root",
type: "XML",
viewData: { component : this }
});
return oview;
}
});
manifest.json like below:
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "Customer.com",
"type": "application",
"title": "Customer Info",
"description": "A simple walkthrough app that explains the most important concepts of OpenUI5",
"applicationVersion": {
"version": "1.0.0"
},
"ach": "CA-UI5-DOC"
},
"sap.ui": {
"_version": "1.1.0",
"technology": "UI5",
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": [
"sap_bluecrystal"
]
},
"sap.ui5": {
"_version": "1.1.0",
"rootView": "Customer.com.view.Root",
"dependencies": {
"minUI5Version": "1.30",
"libs": {
"sap.m": {}
}
}
}
}
Root.view.xml
<core:View
controllerName="Customer.com.view.Master"
xmlns:m="sap.m"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc" >
<SplitApp id="idRoot">
<masterPages>
<mvc:XMLView viewName="Customer.com.view.Master" id="idMaster" />
</masterPages>
<detailPages>
<mvc:XMLView viewName="Customer.com.view.Detail" id="idDetail" />
</detailPages>
</SplitApp>
</core:View>
Index.html like below:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>My Fiori 10</title>
<script
id="sap-ui-bootstrap"
src="/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m, sap.ui.layout"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{
"Customer.com": "./"
}' >
</script>
<script>
sap.ui.localResources("view");
new sap.m.Shell({
app : new sap.ui.core.ComponentContainer({
name : "Customer.com"
})
}).placeAt("content");
</script>
</head>
<body class="sapUiBody" id="content">
</body>
Please guide me where i am doing wrong.
Thanks and Regards,
Hyma
I can point out 2 things here:
1. In the Component.js you are declaring the variable oView (camelcase with a capitalized V) whereas in the return statement of createContent() you are returning oview (with a smallcase v) - please correct this.
2. In your Root.view.xml you have defined an alias m for the sap.m namespace (xmlns:m="sap.m"), you will therefore have to reference to all occurrences of SplitApp as <m:SplitApp>...</m:SplitApp> instead of <SplitApp>...</SplitApp>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the index.html file just replace the reference to the sap-ui-core.js file in the Bootstrap script with the CDN path as below and try to run the app:
replace
src="/resources/sap-ui-core.js"
with
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
Hi All,
The above error resolved .
I have changed the src library to "https://sapui5.hana.ondemand.com/resources/sap-ui-core.js".
Problem solved.
Thanks vakil for your help.
Thanks and Regards,
Hyma
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.