Advertisement
ignatov

Untitled

May 5th, 2020
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     onInit: function() {
  2.             var sServiceUrl = this.getOwnerComponent().getMetadata().getManifestEntry("sap.app").dataSources["zdemo_app"].uri;
  3.             var OdataModel = new sap.ui.model.odata.v2.ODataModel(sServiceUrl);
  4.             var oModel = new sap.ui.model.json.JSONModel();
  5.             var sPath = "/PersonSet";
  6.  
  7.             OdataModel.read(sPath, {
  8.                 success: function(oData, response) {
  9.                     oModel.setData(oData);
  10.                 }
  11.             });
  12.             this.getView().setModel(oModel, "person");
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement