Skip to content

Instantly share code, notes, and snippets.

@ikiw
Created July 17, 2015 14:08
Show Gist options
  • Select an option

  • Save ikiw/07702b6acad9f0b2e9c0 to your computer and use it in GitHub Desktop.

Select an option

Save ikiw/07702b6acad9f0b2e9c0 to your computer and use it in GitHub Desktop.
Component manifest
<!DOCTYPE html>
<html><head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>test</title>
<script id='sap-ui-bootstrap' type='text/javascript'
src='/sapui5/resources/sap-ui-core.js'
data-sap-ui-theme='sap_bluecrystal'
data-sap-ui-libs='sap.m'></script>
<script>
sap.ui.getCore().attachInit(function() {
var MyComponent = sap.ui.core.UIComponent.extend("MyComponent", {
metadata: {
manifest: {
"sap.app": {
"dataSources": {
"northwind": {
"type": "OData",
"uri": "/uilib-sample/proxy/http/services.odata.org/Northwind/Northwind.svc"
}
}
},
"sap.ui5": {
"models": {
// key = model name
"northwind": {
"dataSource": "northwind",
"settings": {
"useBatch": false // additional model constructor settings can also be provided
}
}
}
}
}
},
createContent: function() {
// create a simple List within a App which is bound to the northwind model created above
return new sap.m.App({
pages: new sap.m.Page({
title: "Employees",
content: new sap.m.List({
items: {
path: "northwind>/Employees",
template: new sap.m.StandardListItem({
title: { path: "northwind>FirstName" },
description: { path: "northwind>LastName" }
})
}
})
})
})
}
});
// initialize the UI component
new sap.m.Shell({
app: new sap.ui.core.ComponentContainer({
height : "100%",
component : new MyComponent()
})
}).placeAt("content");
});
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment