title: Sum Column Datatable in PrimeFaces
body: <p>I receive the data in the JSF page by ListDataModel.<br>
  I need sum all values of the column.<br>
  Follows the JSF code:</p>
  
  <p><pre></p>
  
  <pre><code>&lt;p:dataTable id="table" value="#{ProductBean.listProduct}" var="item" style="font-size:"12px" &gt;
  &lt;p:column &gt;
     &lt;f:facet name="header"&gt;
        &lt;h:outputText value="NAME" /&gt;
     &lt;/f:facet &gt;
     &lt;h:outputText value="#{item[0].name}" /&gt;
  &lt;/p:column &gt;
  &lt;p:column &gt;
     &lt;f:facet name="header"&gt;
        &lt;h:outputText value="VALUE BUY" /&gt;
     &lt;/f:facet &gt;
     &lt;h:outputText value="#{item[1].valuebuy}" /&gt;
  &lt;/p:column &gt;
  &lt;p:column &gt;
     &lt;f:facet name="header"&gt;
        &lt;h:outputText value="VALUE SELL" /&gt;
     &lt;/f:facet &gt;
     &lt;h:outputText value="#{item[2].valuesell}" /&gt;
  &lt;/p:column &gt;
  &lt;p:columnGroup type="footer"&gt;  
      &lt;p:row&gt;                                        
         &lt;p:column footerText="Total" /&gt;  
         &lt;p:column footerText="TotalBuy" /&gt;   &lt;&lt;&lt;&lt;--------- Sum All Values of item[1].valuebuy and show here
         &lt;p:column footerText="TotalSell" /&gt;  &lt;&lt;&lt;&lt;--------- Sum All Values of item[2].valuesell and show here                  
      &lt;/p:row&gt;  
  &lt;/p:columnGroup&gt;
  &lt;/p:dataTable &gt;
  </code></pre>
  
  <p></pre></p>