Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display formatted decimal numbers in Primefaces 4 [duplicate]

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.

like image 811
jMarcel Avatar asked Dec 20 '22 22:12

jMarcel


1 Answers

f:convertNumber must be inside h:outputText.

<h:outputText value="#{item.value}">
    <f:convertNumber pattern="#0.000" locale="pt_BR"/>
</h:outputText>
like image 103
Simon Arsenault Avatar answered May 09 '23 21:05

Simon Arsenault