Im trying to bind products of certain categories, in each category there is an expand of products, first of all i list the categories from default oData service read-write only http://services.odata.org/V3/OData/OData.svc
, then by clicking the one of category im taking its path( it returns like: Category(1)
or Category(2)
and etc ), and use it to call the products of this category, but there is a mistake, Aggregation "items" does not exist in Element sap.m.StandardListItem#subcatId what im doing wrong?
here is the code that take the sPath of category then trying to retrieve the list of products of this category:
var app = sap.ui.getCore().byId("appId");
var list = sap.ui.getCore().byId("listId");
var sItem = list.getSelectedItem();
var sPath = sItem.oBindingContexts.data.sPath;
var sCont = sap.ui.getCore().byId("subcatId");
var sCats = new sap.m.StandardListItem({
parameters: {expand: "Products"},
title: "{data>Name}"
})
sCont.bindAggregation("items","data>"+sPath,sCats);
the api's:
http://services.odata.org/V3/OData/OData.svc/Categories
http://services.odata.org/V3/OData/OData.svc/Products
http://services.odata.org/V3/OData/OData.svc/Categories?$expand=Products
thank you all for help!