cancel
Showing results for 
Search instead for 
Did you mean: 

oData bindElement - failed to drill down

Former Member
0 Kudos

I try to generate a Master-/Detail-View with oData.

The onPress in my MasterController:

onItemPress: function(oEvent) {
var oUserContext = oEvent.getSource().getBindingContext("som"); var oUser = oUserContext.getObject();
this.getRouter().navTo("userDetails", {userId: oUser.Id});
}

And in my DetailsController:

onInit: function () {
this.getRouter().getRoute("userDetails").attachPatternMatched(this._onObjectMatched, this);
},

_onObjectMatched: function (oEvent) {
var sUserId = oEvent.getParameter("arguments").userId;
this.getView().bindElement({
path: "/Users('"+sUserId+"')",
model: "som"
});
},


So i want to Display the details:

<Label text="{i18n>settings.user.id}" />
<Input editable="false" value="{som>Id}" />

But i get the following error:

Failed to drill-down into Id, invalid segment: Id - ../oData/Users('44ce4852-5985-44c3-9a75-03e252747d29')?$select=Id sap.ui.model.odata.v4.lib._Cache

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I find the solution:

My oData-Service is returning a list an not a single object. I fixed this, now it is working fine!

Answers (1)

Answers (1)

how did you fix it?