How to create a list in SAPUI5?

SAP HANASAPSAP Basis

I have gone through your code and it looks your list binding is incorrect. When you bind your data, your data should be in a JSON array format.  Please find below the updated working code.

Example

var oModelData =
[
  {Animal: "Kangaroo", Zoo: "Sydney"},
  {Animal: "Tiger", Zoo: "Melbourne"},
  {Animal: "Lion", Zoo: "Alaska"}
];
var oItem = new sap.m.StandardListItem({
   title : "{ Animal }",
   description : "{ Zoo }"
});
var oList = new sap.m.List({
   headerText:" Items",
   items: {
        path: "/",
        template: oItem
    }
});

Hope it helps!

raja
Published on 25-Dec-2017 19:13:23
Advertisements