I'm working with OData V2 Model with enabled batch-support.
When the backend process is running without throwing any exceptions, the Success-Callback is never called.
But when there's a backend exception, the Success-Callback is called (not error-callback, Bug?). Therefore I'm checking for the statuscode in the Success-Callback.
Is there another possibility to get the statuscode or a success-callback in general? Maybe with attachBatchRequestCompleted?
Binding to View:
this.setModel(this.getOwnerComponent().getModel());
this.getModel().metadataLoaded().then(function () {
var sObjectPath = this.getModel().createKey(sEntity, {
UserId: sUserId
});
this.getView().bindElement({
path: "/" + sObjectPath
});
}.bind(this));
Submit-Call:
this.getView().getModel().submitChanges({
success: function (oData) {
try {
if (oData.__batchResponses[0].response.statusCode >= 400) {
//Error
}
} catch (err) {
},
error: function (oError) {
});