在呈现的属性中使用大于逻辑表达式 [英] Using greater than logical expression in rendered attribute

查看:44
本文介绍了在呈现的属性中使用大于逻辑表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个outputText字段,为此我在rendered属性中写了一个条件.条件是将字符串的长度与某个数字值进行比较.

I have an outputText field for which I write a condition in the rendered attribute. The condition is for comparing the length of the string with some numeric value.

<h:outputText id="emailaddress" 
    value ="#{subsAlertsHelper.personEmail.substring(0,20)}"
    rendered="#{subsAlertsHelper.personEmail.length() >20}" />

如果我在rendered中使用==!=,则工作正常.但是对于大于和小于,它没有给出输出.可能是什么原因?

If I use == or != in rendered it is working fine. But for greaterthan and lessthan it is not giving the output. What could be the reason for that?

推荐答案

您必须使用gtlt运算符.

从Sun/Oracle中查看 JavaServer Faces表达式语言简介.恰好是运算符"部分.

Check out JavaServer Faces Expression Language Intro from Sun/Oracle. Precisely the Operators section.

这篇关于在呈现的属性中使用大于逻辑表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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