Skip to Content
0
Jun 21, 2016 at 01:13 PM

Routing & Data binding: Fake XHR onreadystatechange handler threw exception

124 Views

I want to navigate from Master to Detail with a parameter called (ItemID).

But there's an error in console and there are no details in Detail view.

Uncaught TypeError:

Fake XHR onreadystatechange handler threw exception: Cannot read property 'indexOf' of undefined

onInit: function () {
  var oRouter = this.getRouter();
  oRouter.getRoute("AuctionList").attachMatched(this._onRouteMatched, this);
  },


  _onRouteMatched : function (oEvent) {
  var oArgs, oView;

  oArgs = oEvent.getParameter("arguments");
  oView = this.getView();


  oView.bindElement({
  path : "/Detail/" + oArgs.ItemID,
  model: "myData",
  events : {
  change: this._onBindingChange.bind(this),
  dataRequested: function (oEvent) {
  oView.setBusy(true);
  },
  dataReceived: function (oEvent) {
  oView.setBusy(false);
  }
  }
  });
  },


  _onBindingChange : function (oEvent) {
  // No data for the binding
  if (!this.getView().getBindingContext()) {
  this.getRouter().getTargets().display("notFound");
  }
  }