You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Wallace <rw...@thewallacepack.net> on 2006/02/01 00:04:04 UTC
[shale] Outputting formatted numbers
I'm trying to format the output of some numbers. Before, the way I
would do this was:
<h:outputText value="#{myBean.score}">
<f:convertNumber maxFractionDigits="1" />
</h:outputText>
I've tried this with the clay-config.xml with:
<component jsfid="outputScore" extends="outputText">
<element renderId="0" jsfid="convertNumber">
<attributes>
<set name="maxFractionDigits" value="1" />
</attributes>
</element>
</component>
But that gives me a NPE with the message "The component identified by
jsfid convertNumber could not be found." Was the f:convertNumber
component not mapped on purpose or is this a simple oversight?
I tried creating my own mapping using:
<component jsfid="numberConverter" componentType="javax.faces.Number" >
<attributes>
<set name="currencyCode" bindingType="Early" />
<set name="currencySymbol" bindingType="Early" />
<set name="maxFractionDigits" bindingType="Early" />
<set name="minFractionDigits" bindingType="Early" />
<set name="maxIntegerDigits" bindingType="Early" />
<set name="minIntegerDigits" bindingType="Early" />
<set name="pattern" bindingType="Early" />
<set name="groupingUsed" bindingType="Early" />
<set name="integerOnly" bindingType="Early" />
</attributes>
</component>
But that throws an exception saying that javax.faces.Number is an
undefined component type. Any ideas what I did wrong?
Thanks,
Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org