How to create a list in SAPUI5?


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!

Updated on: 12-Dec-2019

753 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements