You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by vov <vo...@mail.ru> on 2010/06/28 11:18:56 UTC

Re: How do you create a toolbar of buttons for a datatabe?

Look to DefaultDataTable addBottomToolbar(new NoRecordsToolbar(this));
You can append custom Bottom Toolbar to your table instead NoRecordsToolbar:

public class MyBottomToolbar extends AbstractToolbar
{
  public MyBottomToolbar(DataTable<?> table)
  {
    super(table);

    RepeatingView headers = new RepeatingView("bottoms");
    add(headers);

    final IColumn<?>[] columns = table.getColumns();
    for (final IColumn<?> column : columns)
    {
      WebMarkupContainer item = new
WebMarkupContainer(headers.newChildId());
      headers.add(item);

      WebMarkupContainer header = new WebMarkupContainer("bottom");
      item.add(header);
      item.setRenderBodyOnly(true);
      header.add(new Button("button", new Model<String>("asdf")));
    }
  }
}

<wicket:panel>
	<tr>
		
			<th wicket:id="bottom"><form><input type="button"
wicket:id="button"/></form></th>
		
	</tr>
</wicket:panel>

in your DateTable constructor addBottomToolbar(new MyBottomToolbar(this));

Also you can create custom Column class for getting uniques property for
every Button(for example instead new Button you will call
column.getButtom())


-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-do-you-create-a-toolbar-of-buttons-for-a-datatabe-tp2270419p2270653.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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