4

I have a database table with a float field and I want to display it through Primefaces. I want to display the numbers formatted as (one thousand, for example): 1.000,00 I tried:

<p:column sortBy="#{item.value}" filterBy="#{item.value}">
  <f:facet name="header">
    <h:outputText value="#{epoBundle.ListUpbTitle_value}"/>
  </f:facet>
<h:outputText value="#{item.value}"/>
<f:convertNumber pattern="#0.000" locale="pt_BR"/>
</p:column>

But got: /WEB-INF/include/entity/upb/List.xhtml @80,55 Parent not an instance of ValueHolder: org.primefaces.component.column.Column@13ec99d0

Can someone help me?

Thanks in advance.

jMarcel
  • 958
  • 5
  • 24
  • 54

1 Answers1

11

f:convertNumber must be inside h:outputText.

<h:outputText value="#{item.value}">
    <f:convertNumber pattern="#0.000" locale="pt_BR"/>
</h:outputText>
Simon Arsenault
  • 1,777
  • 17
  • 35
  • Ok. It worked, but how can I mask the value to be displayed as, for example: 1.000,32 ? Thanks Simon! – jMarcel Nov 01 '13 at 19:15
  • Just press "Ask Question" button to ask a new question? – BalusC Nov 01 '13 at 19:45
  • Ok, I can do it... again (see the beginning of my question): "I want to display the NUMBERS FORMATTED as (one thousand, for example): 1.000,00"... – jMarcel Nov 01 '13 at 20:23