SAPUI5 视图,访问面板标题的模型项 [英] SAPUI5 views, accessing model item for Panel header

查看:42
本文介绍了SAPUI5 视图,访问面板标题的模型项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下模型.

categories [
1: {
    0:{}
    1:{}
    categoryDesc: "Production"
}

2: {
    0:{}
    1:{}
    2:{}
    categoryDesc: "Documentation    
}
]

以及以下视图..

<List id="idList" items="{view>/categories}">
                    <items>
                        <CustomListItem>
                            <Panel expandable="true" expanded="false" headerText="{categoryDesc}">
                                <content>

                                </content>
                            </Panel>
                        </CustomListItem>
                    </items>
                </List>

问题是,正在显示正确数量的面板 (2),但没有显示 categoryDe​​sc.

The Issue is, the correct number of panels are being displayed (2), but categoryDesc is not being displayed.

所以view/>categories"可以很好地获取数组元素 1 和 2,我只是无法检索 categoryDe​​sc.

So "view/>categories" is picking up array element 1 and 2 fine, i just can't retrieve the categoryDesc.

有什么想法吗?

推荐答案

由于您使用的是命名模型,因此您应该使用

since you are using a named model you should use

{view>categoryDesc}

这篇关于SAPUI5 视图,访问面板标题的模型项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆