Hi
I am calling omodel.remove to remove a record from model and it works fine but somehow the success/fail function are not called to give the status. omodel.update works fine and report correct status.
Here is my code
if (this.mode =="Update")
{
var id = self.getView().byId("i1").getValue();
var str = "/Products("+id+")";
var oModel = this.getView().getModel("products");
oModel.update(str, data, {
success : function(oData, oResponse)
{
// Success
alert(" Updated Successfully" );
},
error : function(oError)
{
// Error
alert(" Update failed" );
}
});
}else if (this.mode =="Delete")
{
var id = self.getView().byId("i1").getValue();
var str = "/Products("+id+")";
var oModel = this.getView().getModel("products");
oModel.remove(str, data, {
success : function(oData, oResponse)
{
// Success
console.log(" Deleted Successfully" );
alert(" Deleted Successfully" );
},
error : function(oError)
{
// Error
console.log(" Delete failed" );
alert(" Delete Failed" );
}
});
}