Skip to Content
author's profile photo Former Member
Former Member

ODataModel attachRequestCompleted

Hi there,

I am trying to bind to the attachRequestCompleted event against an ODataModel and the event does not seem to be fired in the case of a create. It appears to fire in the case of a read but not create. Can anybody tell me if this is a known bug and is there any way around it? The code I am using is below.

var oModel = new sap.ui.model.odata.ODataModel(app.getServiceUrlById("someId"));
     console.error("Request Sent");

     console.error("Request Completed");



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 25, 2015 at 05:06 PM

    you are right, _loadData is the only place where they fire RequestSent

    for create you can pass as part of second parameter



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 25, 2015 at 05:08 PM

    but fireRequestCompleted is fired pretty much for all kind of requests

    Add a comment
    10|10000 characters needed characters exceeded

    • Just redefine and odatamodel, it is not as hard as it seems


      sap.ui.model.odata.ODataModel.extend("util.model.MyODataModel", {

      constructor : function(sServiceUrl, bJSON, sUser, sPassword, mHeaders, bTokenHandling, bWithCredentials, bLoadMetadataAsync) {

      sap.ui.model.odata.ODataModel.apply(this, arguments);



      util.model.PSAODataModel.prototype.bindList = function(sPath, oContext, aSorters, aFilters, mParameters, isCachable) {

      return (sPath == "/CustomerSet" ? new util.model.CacheableODataListBinding(this, sPath, oContext, aSorters, aFilters, mParameters)

      : new sap.ui.model.odata.ODataListBinding(this, sPath, oContext, aSorters, aFilters, mParameters));


  • Posted on Sep 09, 2016 at 06:22 AM


    The method attachRequestCompleted method not supported by V4 odata model. That's the reason why you could not fire that event. For more detail, you can see from:

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.