on 07-28-2014 6:31 AM
Hi all, I am trying to call this statement in the onInit function:
this.oApplicationFacade.getODataModel().attachRequestCompleted(jQuery.proxy(this.onRequestCompleted,this));
onInit : function() {
jQuery.sap.require("sap.ca.scfld.md.ComponentBase");
this.oApplicationFacade.getODataModel().attachRequestCompleted(jQuery.proxy(this.onRequestCompleted,this));
.......
},
I am getting this error message: Uncaught TypeError: Cannot call method 'getODataModel' of undefined What went missing here?
Could someone give an example how to use it?
Thank you
Ferry
Hi Ferry,
Did you debug and Check oApplicationFacade ?
Regards,
Madhumahesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhumahesh,
Actually, I am trying to implement the function from the SAP Fiori Change Sales Order. This is the original source code from the Fiori app:
sap.ca.scfld.md.controller.BaseMasterController.extend("cus.sd.salesorder.monitor.view.S2", {
onInit : function() {
sap.ca.scfld.md.controller.BaseMasterController.prototype.onInit.call(this);
this.oApplicationFacade.getODataModel().attachRequestCompleted(jQuery.proxy(this.onRequestCompleted, this));
this.getView().getModel().attachRequestSent(jQuery.proxy(this.onRequestSent, this));
this.setDefaultSelection = false;
this.numberOfRows = 0;
this.numberOfItems = 0;
this.resourceBundle = this.oApplicationFacade.getResourceBundle();
var oModel = new sap.ui.model.json.JSONModel();
oModel.setProperty("Contacts", []);
this.oApplicationFacade.setApplicationModel("contacts", oModel);
// this.getView().getModel().bCountSupported=true; // FIXME: Enable expensive calls for count to make SalesOrder growing list
this.getView().addEventDelegate({
onAfterShow : jQuery.proxy(this.onShow, this)
});
},
But I am stuck when calling the oApplicationFacade.getODataModel() in my code. This is the output of console.log of the fiori app :
Can you provide an example how to call that method in your own code?
Thanks again
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.