微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SAPUI5教程——在XML View中使用$运算符

前言

在HTML5的世界中,之所以有框架的出现,是为了能够方便快捷的开发出我们想要的产品,今天我们来讲一下SAPUI5中一个非常重要而又比较常见的语法——$运算符在xmlView中的使用。

判断语句

不多说,直接上代码

<!--Set to visible if the status is critical and the amount is above the threshold (note escaping of &&)-->
visible="{= ${status} === 'critical' &amp;&amp; ${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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类