Data has been changed in the form and submitBatch has successfully updated the server data. oBinding.hasPendingChanges()
should be false but stays true even though the batch has been successfully submitted.
Why is oBinding.hasPendingChanges() still returning true when it should be false?
groupProperties.Submit can be either API or Auto and the issue persists
Code:
var oBinding = this.byId("idMainTable").getBinding("items");
var oThis = this;
var fnSuccess = function() {
oBinding = this.byId("idMainTable").getBinding("items");
var bChangedAfter = oBinding.hasPendingChanges()
//bChangedAfter should be = false but is still true!! Why?
//The data has been updated correctly at the server.
}.bind(oThis);
var fnError = function(oError) {
//handle error
MessageBox.alert(oError.message);
}.bind(oThis);
if (oBinding.hasPendingChanges()) {
oThis.getView().getModel().submitBatch("ladderList").then(fnSuccess, fnError);
} else {
//Do nothing - no changes to Submit
}