JSF selectItem标签格式 [英] JSF selectItem label formatting

查看:182
本文介绍了JSF selectItem标签格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在此项目中保留xhtml中的所有演示文稿内容,并且我需要在selectItem标记中格式化一些具有BigDecimal值的值,并且需要使其看起来像货币。无论如何应用< f:convertNumber pattern =$#,## 0.00/> 内< f:selectItem> ; tag?

Trying to keep all the presentation stuff in the xhtml on this project and I need to format some values in a selectItem tag have a BigDecimal value and need to make it look like currency. Is there anyway to apply a <f:convertNumber pattern="$#,##0.00"/> Inside a <f:selectItem> tag?

任何方法可以做到这一点或解决方法不涉及将其推入java代码?

Any way to do this or a work around that doesn't involve pushing this into the java code?

推荐答案

在这里做了一些更多的研究后,我非常确信当前的JSF实现是不可能的。没有机会改变价值。

After doing some more research here I'm pretty convinced this isn't possible with the current implementation of JSF. There just isn't an opportunity to transform the value.

http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/f/selectItem.html

tld将 itemLabel 属性显示为 ValueExpression 以及正文内容< f:selectItem> 为空。因此,其中一个标记内不允许存在任何内容,标签必须指向Java模型中的逐字值。所以它的格式是来自Java模型。

The tld shows the itemLabel property as being a ValueExpression and the body content of <f:selectItem> as being empty. So nothing is allowed to exist inside one of these tags, and the label has to point to a verbatim value in the Java model. So it has be be formatted coming out of the Java model.

这篇关于JSF selectItem标签格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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