cancel
Showing results for 
Search instead for 
Did you mean: 

The Following error occurred: No Handler for Data

Former Member
0 Kudos

Hi,

I was making a read function for my oDatamodel, but after running my application i get this error when i check my console in Chrome:

The following problem occurred: no handler for data -

This is the function which contains the read function. For some extra information i am using the sap.ui.model.odata.v2.ODataModel for this application.


  _downloadFile: function() {

  var oModel = this.getView().getModel();

  var selectedDocument = this.getView().getBindingContext().getObject();

  var sRead ="/PDFSet(MyDocKey='',SCObjid='',AcadYear='',AcadPeriod='',Cokey='"+selectedDocument.Cokey+"',Cotyp='"+selectedDocument.Cotyp+"')/$value";

  oModel.read(sRead, {

    success: function(oData, oResponse){

        console.log(".. oModel.read success: " + oData.results.length);

        console.log(oData);

        console.log(oResponse);

    },

    error: function(oError){

      console.log(".. oModel.read failed");

      var errorObj1 = JSON.parse(oError.responseText); 

      console.log(errorObj1);

    }

});

  }

I hope you can help me figure out what i am missing or doing wrong.


Kind Regards,


Arun


Accepted Solutions (0)

Answers (4)

Answers (4)

daihao
Employee
Employee
0 Kudos

Hi,

You can find the root cause and some alternative ways in this Github issue - https://github.com/SAP/openui5/issues/3519

Regards,

Hao

Former Member
0 Kudos

Hi everyone,

We have tried something else. We also tried using the jQuery.proxy, but still we get the
no handler for data message.

This is the function we made:


fSuccess : function(oEvent){

     console.log(oEvent);

     console.log("succes");

},

fError : function(oEvent){

   console.log(oEvent);

    console.log("error");

},

_downloadFile : function (){

var oModel = this.getView().getModel();

var selectedDocument = this.getView().getBindingContext().getObject();

var sRead = "/PDFSet(MyDocKey=' ', SCObjid=' ',AcadYear=' ', AcadPeriod = ' ', Cokey = ' " + selectedDocument.Cokey + "', Cotyp= '" +

selectedDocument.Cotyp + "' )/$value";

}

oModel.read(sRead, {

success : jQuery.proxy(this.fSuccess, this),

error: jQuery.proxy(this.fError, this)

});

},

When we run the the following will be shown in the console

and when we are debugging we see the following:

I hope you can help me solve this

Kind regards,

Arun

Former Member
0 Kudos

Have you guys able to resolve this issue?

former_member276862
Discoverer
0 Kudos

Hi,

Even i got same Error.

Have you guys resolve it,

If Yes plz provide your valuable suggestion.

Regards,

Rajesh Roy

0 Kudos

Hi, i am too facing this problem. I am trying to run my application via a mockserver; this is now working partially, except for this error...
Hope there is maybe a solution to this.

Regards,

Joas

Gairik
Participant
0 Kudos

Hi Arun,

Would you mind to put a breakpoint in the first line of the function and then check in which line it is throwing th error ?

Regards,

Gairik

Former Member
0 Kudos

in our console we see this screen.

We put a breakpoint on several lines here are the results:

Do you need anything else?

Kind regards,

Arun

Gairik
Participant
0 Kudos

Hi Arun,

Please try one of the following

1. Please pay attention to the details that parameter name "success" should NOT be used here

  1. oModel.read(sRead, { 
  2.    null, null,true, function(oData, oResponse){ 
  3.         console.log(".. oModel.read success: " + oData.results.length); 
  4.         console.log(oData); 
  5.         console.log(oResponse);  
  6.     }, 

OR

2.This is call with the parameter names.

  1.   oModel.read(sRead, { 
  2.    context : null,
  3. urlParameters : null,
  4. async : true,
  5.     success: function(oData, oResponse){ 
  6.         console.log(".. oModel.read success: " + oData.results.length); 
  7.         console.log(oData); 
  8.         console.log(oResponse);  
  9.     }, 
saurabh_vakil
Active Contributor
0 Kudos

Hi Arun,

Have you tried calling the read function like below (2 null parameters for context and urlParameters):

Reference - SAPUI5 SDK - Demo Kit


oModel.read(sRead, null, null,

     function(oData, oResponse){.....},

     function(oError){....}

);

Regards,

Saurabh

Former Member
0 Kudos

Hi Saurabh,

I also tried this and I got the same result. I still got the No handler for data error.

Former Member
0 Kudos

Hi Saurabh,

Do you maybe have any other ideas what might cause this error?

Kind regards,

Arun