Skip to Content
0

oData bindElement - failed to drill down

Mar 12 at 05:06 PM

90

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Mar 17 at 04:34 PM
0

I find the solution:

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

Share
10 |10000 characters needed characters left characters exceeded