Hey everyone,
I'm facing an issue with the sap.ui.model.odata.ODataModel in SAPUI5 1.16.4. On using the create() function, as below, I get the attached error.
createEntry: function(sChannelId, sEventId, oData) {
sap.ui.getCore().getModel("COMP").create(
"/COMPONENT", // path
oData, // data
null, // oContext
function(oData, response) { // success
sap.m.MessageToast.show("Success");
},
function(oError) { // error
console.log(oError);
sap.m.MessageToast.show("Error! (Check Log for additional information)", {
duration: 10000
});
});
}
The error occurs before any server communication, it is unrelated to the web service. I get this behavior on any service and any odata model I use. The same error occurs if I use createEntry() and submitChanges() on the odata model.
Is there anybody facing the same issue? Do I call the function incorrect?
Any help is highly appreciated because I don't want to start using ajax and keep the UI up to date by hand.
Best,
Mathias
----
On the stack the entry "sap.ui.controller.onAddTemplatePress (main.controller.js:64)" is related to my code.
- 2014-04-16 11:57:43 The following problem occurred: undefined is not a function - sap-ui-core.js:77
- usap-ui-core.js:77
- fatalsap-ui-core.js:77
- sap.ui.model.odata.ODataModel._handleErrorODataModel.js:35
- aODataModel.js:32
- o.requestdatajs.js:17
- cODataModel.js:32
- bODataModel.js:32
- _ODataModel.js:31
- (anonymous function)datajs.js:17
- n9datajs.js:17
- o.defaultHttpClient.requestdatajs.js:17
- D2datajs.js:17
- o.requestdatajs.js:17
- o.readdatajs.js:17
- sap.ui.model.odata.ODataModel.refreshSecurityTokenODataModel.js:31
- sap.ui.model.odata.ODataModel._submitChangeODataModel.js:32
- sap.ui.model.odata.ODataModel.createODataModel.js:42
- sap.ui.controller.onAddTemplatePressmain.controller.js:64
- sap.ui.base.EventProvider.fireEventsap-ui-core.js:117
- sap.ui.core.Element.fireEventsap-ui-core.js:117
- (anonymous function)sap-ui-core.js:117
- sap.ui.commons.Button.onclickButton.js:7
- sap.ui.core.Element._callEventHandlessap-ui-core.js:117
- sap.ui.core.Element._handleEventsap-ui-core.js:117
- sap.ui.core.UIArea._handleEventsap-ui-core.js:117
- f3sap-ui-core.js:18
- Q.event.dispatchsap-ui-core.js:18
- i.handle.jsap-ui-core.js:18