on 03-12-2018 5:06 PM
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
I find the solution:
My oData-Service is returning a list an not a single object. I fixed this, now it is working fine!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how did you fix it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.