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?
Any way to do this or a work around that doesn’t involve pushing this into the java code?
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
The tld shows the
itemLabelproperty as being aValueExpressionand 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.