The following doesn't work as I'd hoped:
<ul>
<ui:repeat var="i" value="#{fn:split('1,2,3,4', ',')}">
<li>
<h:outputText value="1.2345">
<f:convertNumber
minFractionDigits="#{i}"
maxFractionDigits="#{i}" />
</h:outputText>
</li>
</ui:repeat>
</ul>
I was hoping to see:
- 1.2
- 1.23
- 1.234
- 1.2345
Instead I see:
- 1
- 1
- 1
- 1
What am I missing? My guess is that the converter is initialised when the Facelet is initially loaded, before the run-time looping occurs. Is there a way around this?
My real use-case involves a RichFaces rich:dataTable
component instead of a ui:repeat
, but the gist is the same.