showing results for - "creating a json model sap ui5"
Elissa
26 Oct 2019
1#!jssap.ui.define([
2   "sap/ui/core/mvc/Controller",
3   "sap/m/MessageToast",
4   "sap/ui/model/json/JSONModel"
5], function (Controller, MessageToast, JSONModel) {
6   "use strict";
7   return Controller.extend("sap.ui.demo.wt.controller.App", {
8      onInit : function () {
9         // set data model on view
10         var oData = {
11            recipient : {
12               name : "World"
13            }
14         };
15         var oModel = new JSONModel(oData);
16         this.getView().setModel(oModel);
17      },
18      onShowHello : function () {
19         MessageToast.show("Hello World");
20      }
21   });
22});