Skip to Content
0
Former Member
Jan 21, 2015 at 09:45 AM

attachRequestCompleted behaviou

706 Views

Hi Guys,

I implemented an ODate request and attached a RequestSent and a RequestCompleted eventhandler. The first calls a function to show a BusyDialog and the second one calls a function to close the BusyDialog.

The request has the following timing:

The waiting time can be something between 7s and 15s (I know that this is quite some time^^).

My Problem is, that the SDK states the following:

The 'requestCompleted' event is fired, after a request has been completed (includes receiving a response), no matter whether the request succeeded or not.

In my opinion this means, that my RequestCompleted event would be called after the waiting and download time. Strangely though, it gets called right away and I do not see any BusyDialog.


This is some of my code:

var model = sap.ui.getCore().getModel();
  model.attachRequestSent(view.getController().handleRequestSent());
  model.attachRequestCompleted(view.getController().handleRequestCompleted())
handleRequestSent : function () {
  bs = new sap.m.BusyDialog("busybusy");
  bs.placeAt("content");
  bs.open();
  },

handleRequestCompleted : function () {
  bs = sap.ui.getCore().byId("busybusy");
  bs.close();
  bs.destroy();
  }

Can anybody explain this behaviour to me ?

Thanks

Attachments

request.PNG (7.0 kB)