Ok, here is my code for the TotalsToolbar that I am adding as a
BottomTooolbar to my table.

public class TotalsToolbar extends AbstractToolbar
{

    public TotalsToolbar(final DataTable table, final IDataProvider
dataProvider)
    {
        super(table);

        RepeatingView totals = new RepeatingView("totals");
        add(totals);

        final IColumn[] columns = table.getColumns();
        for (int i = 0; i < columns.length; i++)
        {
            final IColumn column = columns[i];

            WebMarkupContainer item = new
WebMarkupContainer(totals.newChildId());
            totals.add(item);

            WebMarkupContainer total = new WebMarkupContainer("total");

            item.add(total);
            item.setRenderBodyOnly(true);
            if (i == 0)
                total.add(new Label("value", "Grand Total"));
            else
                total.add(new Label("value", "$0.00"));

        }
    }

As you can see I am passing in a dataProvider into the constructor, but I do
not know how to use it. How do I replace the hardcoded "$0.00" value (look
towards the end of the code) with a value coming from the dataProvider?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Displaying-column-totals-for-a-DefaultDataTable-tp25402522p25475784.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to