Skip to content

Instantly share code, notes, and snippets.

@fabiopagoti
Created September 18, 2020 18:11
Show Gist options
  • Select an option

  • Save fabiopagoti/9bd46a7e8c6327aff99d713f1fd9d834 to your computer and use it in GitHub Desktop.

Select an option

Save fabiopagoti/9bd46a7e8c6327aff99d713f1fd9d834 to your computer and use it in GitHub Desktop.
McrCoderDojo : Public Github Repos for Users // source https://jsbin.com/xofaweq
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>McrCoderDojo : Public Github Repos for Users</title>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
>
</script>
<script id="main" type="ui5/xmlview">
<mvc:View
controllerName="local.controller.main"
displayBlock="true"
xmlns:mvc="sap.ui.core.mvc"
xmlns:core="sap.ui.core"
xmlns="sap.m">
<Text text="{/value}"/>
<Input value="{/value}" valueLiveUpdate="true" liveChange="onLiveChange" />
</mvc:View>
</script>
<script>
// Local controller
sap.ui.controller("local.controller.main", {
onInit: function(){
this._mod = new sap.ui.model.json.JSONModel({
value: ""
});
this.getView().setModel(this._mod);
},
onLiveChange : function(oEvent) {
var sValue = this._mod.getProperty("/value");
if(sValue){
sValue = sValue.replace(/ /g, "");
this._mod.setProperty("/value", sValue);
}
}
});
sap.ui.xmlview({ viewContent: jQuery("#main").html() }).placeAt("content");
</script>
</head>
<body id="content"
class="sapUiBody" />
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment