Last active
June 29, 2017 03:20
-
-
Save jizusun/c85c0420b92a23c6d111ef4c7058bc1f to your computer and use it in GitHub Desktop.
// source https://jsbin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta charset="utf-8"> | |
<title>MVC with XmlView</title> | |
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script> | |
<script id="view1" type="sapui5/xmlview"> | |
<mvc:View | |
controllerName="local.controller" | |
xmlns:mvc="sap.ui.core.mvc" | |
xmlns="sap.m"> | |
<Button | |
text="Hello UI5 World" | |
press="doSomething" /> | |
<List | |
id="people" | |
items="{/people}"> | |
<DisplayListItem | |
label="{name}" | |
value="{number}" /> | |
</List> | |
</mvc:View> | |
</script> | |
</head> | |
<body class='sapUiBody'> | |
<div id='content'></div> | |
<script id="jsbin-javascript"> | |
jQuery.sap.require("sap.m.MessageToast"); | |
sap.ui.controller("local.controller", { | |
doSomething: function() { | |
sap.m.MessageToast.show("Hello UI5 World"); | |
} | |
}); | |
var oModel = new sap.ui.model.json.JSONModel({ | |
people: [ | |
{ name: 'Joseph', number: 1.618 }, | |
{ name: 'DJ', number: 0 } | |
] | |
}); | |
var oView = sap.ui.xmlview({ | |
viewContent: jQuery('#view1').html() | |
}); | |
oView.setModel(oModel); | |
oView.placeAt('content'); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">jQuery.sap.require("sap.m.MessageToast"); | |
sap.ui.controller("local.controller", { | |
doSomething: function() { | |
sap.m.MessageToast.show("Hello UI5 World"); | |
} | |
}); | |
var oModel = new sap.ui.model.json.JSONModel({ | |
people: [ | |
{ name: 'Joseph', number: 1.618 }, | |
{ name: 'DJ', number: 0 } | |
] | |
}); | |
var oView = sap.ui.xmlview({ | |
viewContent: jQuery('#view1').html() | |
}); | |
oView.setModel(oModel); | |
oView.placeAt('content'); | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.sap.require("sap.m.MessageToast"); | |
sap.ui.controller("local.controller", { | |
doSomething: function() { | |
sap.m.MessageToast.show("Hello UI5 World"); | |
} | |
}); | |
var oModel = new sap.ui.model.json.JSONModel({ | |
people: [ | |
{ name: 'Joseph', number: 1.618 }, | |
{ name: 'DJ', number: 0 } | |
] | |
}); | |
var oView = sap.ui.xmlview({ | |
viewContent: jQuery('#view1').html() | |
}); | |
oView.setModel(oModel); | |
oView.placeAt('content'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment