Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sap.ui.define([
- "sap/ui/core/mvc/Controller",
- "sap/ui/model/odata/v2/ODataModel"
- ], function(Controller, ODataModel) {
- "use strict";
- return Controller.extend("com.app2.controller.View1", {
- onInit: function() {
- var sUrl = "/sap/opu/odata/SAP/ZDEMO_APP1_SRV";
- var oDataModel = new sap.ui.model.odata.v2.ODataModel(sUrl, {
- json: true,
- loadMetadataAsync: true
- });
- oDataModel.setUseBatch(false);
- var oModel = new sap.ui.model.json.JSONModel();
- oDataModel.read("/PersonSet", {
- success: function(oData, response) {
- oModel.setData(oData);
- var oTempResult = oData.results;
- }});
- this.getView().setModel(oModel, "person");
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement