SAPUI5教程——在XML View中使用$运算符
发布时间:2020-12-16 01:59:32 所属栏目:百科 来源:网络整理
导读:前言 在HTML5的世界中,之所以有框架的出现,是为了能够方便快捷的开发出我们想要的产品,今天我们来讲一下SAPUI5中一个非常重要而又比较常见的语法——$运算符在xmlView中的使用。 判断语句 不多说,直接上代码: !--Set to visible if the status is criti
前言在HTML5的世界中,之所以有框架的出现,是为了能够方便快捷的开发出我们想要的产品,今天我们来讲一下SAPUI5中一个非常重要而又比较常见的语法——$运算符在xmlView中的使用。 判断语句不多说,直接上代码: <!--Set to visible if the status is critical and the amount is above the threshold (note escaping of &&)-->
visible="{= ${status} === 'critical' && ${amount} > 10000 }"
<!--Text for amount level using language-dependent texts from the resource model.-->
text="{= ${/amount} > 10000 ? ${i18n>/high} : ${i18n>/normal} }"
<!--Set to visible if the rating is VIP,ignoring case or if the order amount is greater than 10,000.-->
visible="{= ${/rating}.toUpperCase() === 'VIP' || ${/orderAmount} > 10000 }"
<!--Set to visible if the rating contains VIP,ignoring the case. -->
visible={= RegExp('vip','i').test(${/rating}) }
<!--Text is maximum of three values.-->
text="{= Math.max(${/value1},${/value2},${/value3}) }"
<!--Control is enabled only if the order status is set.-->
enabled="{= ${/orderStatus} !== null }"
更多教程: http://edu.csdn.net/course/detail/5046 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- c# – 使用Semaphore调用WaitOne是否释放调用线程
- postgresql – 将所有列记录转换为小写
- ORA-00603\ORA-27504\ORA-27300\ORA
- c – 这个宏是什么意思? #define UNUSED(x)((x)
- c# – 在WinRT中使用FadeInThemeAnimation作为转
- objective-c – Sprite Kit改变了锚点,但保持物理
- swift算法实践(4)-trie自动机
- 浅谈Vue的基本应用
- AJAX 自学练习 无刷新提交并修改数据库数据并显示
- ruby-on-rails – 无法在Snow Leopard上安装乘客
热点阅读