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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -