javascript - SAPUI5 List Data Binding Array -
i want bind list , content model.
var ot = new sap.m.standardlistitem({ title: "{cardatamodel>/cars/1/carid}", }); var olist = new sap.m.list("carlist", { }); olist.binditems('cardatamodel>/cars', ot);
i attached following model view:
{ "cars":[ { "carid":"e7f2b1519ed5", "carname":"one", }, { "carid":"f3ab598a85e0", "carname":"two", } ] }
this way list consisting of 2 list items , changing 1 0 can switch between values. want first carid apppear in first item , second in second. tried several syntaxes resulted empty list item.
thank you!
you referencing absolute path title in template. change relative path (i.e., relative current item in list) instead:
var ot = new sap.m.standardlistitem({ title: "{cardatamodel>carid}", });
Comments
Post a Comment