Sapui5 当数组是对象的属性时,如何将数组绑定到列表
我的目标如下:Sapui5 当数组是对象的属性时,如何将数组绑定到列表,sapui5,Sapui5,我的目标如下: parent = { prop1: "asd", prop2: "zxc", arr: [ { title: "qwe", attr: {attr1: "987", attr2: "dfg"} }, { title: "poi"
parent = {
prop1: "asd",
prop2: "zxc",
arr: [
{
title: "qwe",
attr: {attr1: "987", attr2: "dfg"}
},
{
title: "poi",
attr: {attr1: "345", attr2: "jkl"}
}
]
}
我想将其绑定到以下列表:
<List id="list" items="{parent>/arr}" headerText="Example">
<items>
<ObjectListItem title="{parent>arr/title}" type="Active" press="onListItemPress">
<attributes>
<ObjectAttribute text="{parent>arr/attr/attr2}" />
</attributes>
</ObjectListItem>
</items>
</List>
我就是做不到
在此列表中显示标题和属性的正确方式是什么?请尝试下面的语法视图绑定:
<List id="list" items="{parent>/arr}" headerText="Example">
<items>
<ObjectListItem title="{parent>title}" type="Active" press="onListItemPress">
<attributes>
<ObjectAttribute text="{parent>attr/attr2}" />
</attributes>
</ObjectListItem>
</items>
</List>