首页 > 解决方案 > 你能在 SAPUI5 的一个列表中加入两个 oModel

问题描述

您好我正在尝试显示一个从两个不同的 oModel 获取数据的列表。

var Countries = {
    "countries":[
        {
            'country' : "AUS",
            'country_name' : "Australia"
        },
        {
            'country' : "USA",
            'country_name' : "United States of America"
        },
    ]
};

var CountriesStatus = {
    "countries":[
        {
            'country':"AUS",
            'status':"inactive"
        },
        {
            'country':"USA",
            'status':"active"
        }
    ]
};

Countries>country_name是否可以加载标题和描述的单个列表CountriesStatus>status

标签: sapui5

解决方案


据我所知,这是不可能的。ListBinding只接受一个模型。这意味着,如果要绑定聚合,则必须将数据加入单个模型并绑定该模型。


推荐阅读