MyDataProvider provider = new MyDataProvider();
List<IColumn<Object>> cols = new ArrayList<IColumn<Object>>();
cols.add(new PropertyColumn<Object>(new
Model<String>(getString("MyList.Id")), "ID", "ID"));
cols.add(new TextFilteredPropertyColumn<Object, String>(new
Model<String>(getString("MyList.Name")), "Name", "Name"));
cols.add(new PropertyColumn<Object>(new
Model<String>(getString("MyList.Director")), "Director", "Director"));
cols.add(new TextFilteredPropertyColumn<Object,String>(new
Model<String>(getString("MyList.Path")), "Path", "Path"));
cols.add(new FilteredAbstractColumn<Object>(new
Model<String>(getString("List.Actions"))) {
private static final long serialVersionUID = -1307593973143740668L;
public Component getFilter(String componentId, FilterForm form) {
return new GoAndClearFilter(componentId, form,
new ResourceModel("List.Filter"),
new ResourceModel("List.Clear"));
}
public void populateItem(Item<ICellPopulator<Object>> cellItem,
String componentId, IModel<Object> rowModel) {
cellItem.add(new MyActionsPanel(componentId, rowModel));
}
});
AjaxDataTable dataTable = new AjaxDataTable("table", cols, provider, 2);
final FilterForm form = new FilterForm("filter-form", provider);
dataTable.addTopToolbar(new FilterToolbar(dataTable, form, provider));
form.add(dataTable);
add(form);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]