javascript - Controller 中的表达式绑定(bind)

标签 javascript xml binding sapui5

有谁知道是否可以在 javascript 中使用表达式绑定(bind),例如使用 bindProperty 方法?

我希望能够像这样使用它:

new sap.m.Text().bindProperty("text", "= !${myModel>PropertyBoolean}")

我从 SAP 找到的只是 XML View 的文档: help.sap.com

最佳答案

为 XMLViews 引入了表达式绑定(bind)以允许一些基本的编码(这对于 XML 是不可能的)

在 Javascript 中,这当然不是必需的。在您的示例中,您可以简单地使用格式化程序函数:

new sap.m.Text().bindProperty("text", "myModel>PropertyBoolean", function(bValue) {
    return !bValue;
});

关于javascript - Controller 中的表达式绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37747521/

相关文章:

javascript - XSLT 不适用于 IE 11,不会转换 xml

java - 我得到了非封闭类

C# WPF DatePicker 绑定(bind)

javascript - 如何使用 CSS 在 UL LI TreeView 中进行搜索

javascript - :first selector checks against parents parent, 而不是父容器

javascript websocket 客户端

c# - 使用自己的数据的 UserControl

javascript - 如何在 Javascript 中获取和隐藏 sibling

.net - Sql Server Xml 数据类型 - 如何强制完整结束元素

Cocoa - 如何在 InterfaceBuilder 中绑定(bind) NSView 的宽度?