Thanks, Igor. Copied below is the implementation for my toolbar. Could you
please take a look and see if you can spot a problem with it?

public class TotalsToolbar extends AbstractToolbar
{

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

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

        AbstractReportingBean row =
(AbstractReportingBean)dataProvider.iterator(0, 1).next();
        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);

                String val =
row.getStringForFieldNamed(column.getSortProperty());
                if (val == null || val.length() == 0) {
                    val = "&nbsp;";
                    total.add(new Label("value",
val).setEscapeModelStrings(false));
                } else
                    total.add(new Label("value", val));
 
        }
    }
}

This is how I add the toolbar to my table:

public class GrandTotalsDataTable extends DefaultDataTable {
    public GrandTotalsDataTable(String id, final List columns,
            ISortableDataProvider sortableDataProvider, IDataProvider
dataProvider,
            int rowsPerPage)
    {
        super(id, columns, sortableDataProvider, rowsPerPage);
        addBottomToolbar(new TotalsToolbar(this, dataProvider));
    }

}


Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-toolbar-to-update-on-page-refresh-tp2233347p2233368.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to