【发布时间】:2016-02-03 15:04:01
【问题描述】:
我制作了一个使用f:convertNumber 的JSF 复合组件。但是,它不能转换价值。这是如何引起的,我该如何解决?
currency.xhtml
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:f="http://java.sun.com/jsf/core">
<composite:interface>
</composite:interface>
<composite:implementation>
<f:convertNumber pattern="#,###" currencyCode="\\"/>
</composite:implementation>
</html>
index.xhtml
...
<h:outputText value="10000000">
<mycomp:currency />
</h:outputText>
...
结果
10000000
【问题讨论】:
-
“无法转换”含糊不清。是否愿意更明确地描述问题以及实际发生了什么?
-
@Kukeltje 谢谢,我希望我的 Composit Componet(currency.xhtml) 将 h:outputText 的值转换为“10,000,000”作为模式属性 (#,###)。但是,它显示“10000000”。因此,我认为转换器无法转换值。
标签: jsf converter composite-component