如何在 XML 视图中绑定过滤器值 [英] How to bind filter values in XML view

查看:32
本文介绍了如何在 XML 视图中绑定过滤器值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Web IDE 的工作列表模板开发应用程序.我遇到了将过滤器值绑定到 sap.m.Table 的 items 属性以及 OData - EntitySet 路径的问题.正如您在下面的屏幕截图中看到的,value1 需要获取属性 "name" 的值.我想我使用的语法可能是错误的.

I am developing an app using worklist template of Web IDE. I got stuck in with an issue in binding filter values to items attribute of sap.m.Table along with OData - EntitySet path. As you can see in below screen shot, value1 needs to get value of property "name". I guess the syntax that I am using might be wrong.

请建议如何将动态值传递给过滤器.

Please suggest on how to pass dynamic values to filter.

使用 XML 视图中的上述代码,我看到下面显示后端的值.

With the above code in XML view I am seeing below show values in back end.

推荐答案

遗憾的是,UI5 尚不支持 filterssorter 的绑定语法.value1(和 value2)中的字符串不会被解析,而是按字面意思处理.看起来这样的绑定在不久的将来将不受支持尽管是 在backlock 和强烈要求的功能之一.

Unfortunately, UI5 doesn't support binding syntax for filters and sorter yet. The strings in value1 (and value2) will not be parsed but taken literally. And it looks like such bindings won't be supported in near future either despite being on the backlock and one of the highly requested features.

在那之前,我们必须使用 bindItems,在绑定信息对象的filters 属性上设置sap.ui.model.Filter 实例,并手动从所需模型中获取过滤器值而不是使用绑定语法.

Until then, we've to use bindItems, set sap.ui.model.Filter instances on the filters property of the binding info object, and get the filter values from the desired model manually instead of using binding syntax.

示例:https://embed.plnkr.co/AoIZI4/

这篇关于如何在 XML 视图中绑定过滤器值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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