diff --git a/webapp/controller/Home.controller.js b/webapp/controller/Home.controller.js index 50e9d53..f521217 100644 --- a/webapp/controller/Home.controller.js +++ b/webapp/controller/Home.controller.js @@ -8,11 +8,15 @@ sap.ui.define( return BaseController.extend("com.mrb.UI5-Data-Binding.controller.Home", { onInit: function () { + // Create a JSON model from an object literal var oModel = new JSONModel({ - greetingText: "Hi, my name is Marco", + firstName: "Harry", + lastName: "Hawk", + enabled: true, + panelHeaderText: "Data Binding Basics", }); - //Set model globally for all views/controls (dirty) "sap.ui.getCore().setModel(oModel);"" + //Set model globally for all views/controls (dirty) "sap.ui.getCore().setModel(oModel);"" //the go-to way for global definition would be to define the model within the manifest.json-file //and retrieve it via "this.getOwnerComponent().getModel();" this.getView().setModel(oModel); diff --git a/webapp/view/Home.view.xml b/webapp/view/Home.view.xml index 2a74f62..894c35a 100644 --- a/webapp/view/Home.view.xml +++ b/webapp/view/Home.view.xml @@ -1,10 +1,15 @@ - - - - - - + + + + + + \ No newline at end of file