Datatable filtered sum total column

UI Components for JSF
Post Reply
vitoco
Posts: 2
Joined: 12 Sep 2014, 02:39

30 Jan 2015, 21:19

Hello, I have a datatable PrimeFaces problem. I want to calculate the total value of a column using the PF filter ('widgervar'). filter () works perfectly. but I can not add up the total value of the column when the table is filtered.

Code: Select all


public float getValorneto() {
        float valor_neto = 0.0f;
        for (Detallepre d : tbldetallepresupuesto) {
            valor_neto += (d.getRedimiento() * d.getPrecioUnitario());
        }
        return valor_neto;
    }

I can only add up the total value but entire table unfiltered there any way
and filtered through the table to perform the calculations.

Thank You.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 23 guests