0

I have a problem with the f:convertNumber tag in my composite component.

<c:when test="#{cc.attrs.bean.dataTyp eq 'Double'}">
<h:outputText converter="javax.faces.Double" value="#{cc.attrs.bean.dataObject.data.value} ">
    <f:convertNumber groupingUsed="false" maxFractionDigits="5" minFractionDigits="3" />
</h:outputText>

The composite component is called in a datatable. It looks like the f:convertNumber tag will be ignored.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

2

JSTL flow control tags don't work in composites which are by itself referenced inside repeating JSF components. JSTL tags run only once when the composite is about to be instantiated. There's ultimately only one instance of the composite inside the repeating JSF component which get rendered multiple times. JSTL tags run during view build time (read: during the instantiation of the composite component), not during view render time (read: when the composite component need to generate HTML).

Either replace <c:choose><c:when> by rendered attribute,

<h:outputText ... rendered="#{cc.attrs.bean.dataTyp eq 'Double'}">
    <f:convertNumber ... />
</h:outputText>

or create a tag file instead of a composite component.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555