I want to display a masked number like this: 1.234.567,89. The following code already do this:
<p:column>
<h:outputText value="#{item.value}">
<f:convertNumber locale="pt_BR"/>
</h:outputText>
</p:column>
How can I applly the same mask for a Primefaces datatable in a footerText column as the following code excerpt?
<p:columnGroup type="footer">
<p:row>
<p:column colspan="8" footerText="Grand Total:" />
<p:column footerText="#{upbController.totalLosses}" />
</p:row>
</p:columnGroup>
Thanks in advance.
You can try to place your footerText using f:facet. Here is how I used to use it for p:column:
<p:column headerText="Number of units" >
<h:outputText value="#{item.units}" />
<f:facet name="footer">
<h:outputText
value="Total: #{mybean.unitsTotal}" />
<br />
<h:outputText
value="To do: #{mybean.unitsTodo}" />
</f:facet>
</p:column>
I suspect that it would work also for p:columnGroup and then you can apply f:convertNumber to such h:outputText.
And here's how works for header facet in header type:
<p:columnGroup type="header">
<p:row>
<p:column rowspan="2" headerText="Manufacturer" />
<p:column colspan="2">
<f:facet name="header">
<h:outputText value="#{bean.countValue(bean.order)}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" currencyCode="PLN" locale="pl_PL" />
</h:outputText>
</f:facet>
</p:column>
</p:row>
</p:columnGroup>
and for footer facet in footer type:
<p:columnGroup rendered="true" type="footer">
<p:row>
<p:column rowspan="2" headerText="Manufacturer" />
<p:column colspan="2">
<f:facet name="footer">
<h:outputText value="#{bean.countPieces(bean.order)}">
<f:convertNumber pattern="###,###.00" locale="pl_PL"/>
</h:outputText>
</f:facet>
</p:column>
</p:row>
</p:columnGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With