Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

Error: Sucess function not called with omodel.remove

$
0
0

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" ); 

        } 

   }); 

  }


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>