cleanup
This commit is contained in:
parent
633015a5cc
commit
cf49243bd8
@ -32,7 +32,6 @@ public class CheckListTemplateDataPanel extends Panel {
|
||||
AjaxDropDown<Integer> numberDropDown;
|
||||
ChecklistTemplateProvider checklistTemplateProvider;
|
||||
|
||||
|
||||
public CheckListTemplateDataPanel(String id) {
|
||||
super(id);
|
||||
|
||||
@ -61,25 +60,12 @@ public class CheckListTemplateDataPanel extends Panel {
|
||||
add(numberDropDown);
|
||||
|
||||
IColumn[] columns = new IColumn[2];
|
||||
|
||||
// columns[0] = new PropertyColumn<CheckListTemplate>(Model.of("Name"), "name", "name");
|
||||
// columns[1] = new PropertyColumn<CheckListTemplate>(Model.of("Creator"), "creator", "creator");
|
||||
|
||||
columns[0] = new PropertyColumn<CheckListTemplate>(Model.of("Name"), "name");
|
||||
columns[1] = new PropertyColumn<CheckListTemplate>(Model.of("Creator"), "creator");
|
||||
|
||||
// the methods below work too
|
||||
// columns[0] = new PropertyColumn(new Model("Name"), "name", "name");
|
||||
// columns[1] = new PropertyColumn(new Model("Creator"), "creator", "creator");
|
||||
// columns[0] = new PropertyColumn<CheckListTemplate>(new Model("Name"), "name", "name");
|
||||
// columns[1] = new PropertyColumn<CheckListTemplate>(new Model("Creator"), "creator", "creator");
|
||||
|
||||
table = new DataTable<CheckListTemplate>("datatable", columns, checklistTemplateProvider = new ChecklistTemplateProvider(), 10);
|
||||
table.setOutputMarkupId(true);
|
||||
table.addBottomToolbar(navigationToolbar = new NavigationToolbar(table));
|
||||
// none of these work
|
||||
// table.add(new HeadersToolbar(table));
|
||||
// table.add(new HeadersToolbar(table, null));
|
||||
table.addTopToolbar(new HeadersToolbar(table, null));
|
||||
add(table);
|
||||
|
||||
@ -95,13 +81,11 @@ public class CheckListTemplateDataPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public Iterator<? extends CheckListTemplate> iterator(int first, int count) {
|
||||
// return checklistTemplateService.findAll(new PageRequest(table.getCurrentPage(), count)).iterator();
|
||||
return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), count)).iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
// return safeLongToInt(checklistTemplateService.count());
|
||||
return safeLongToInt(checklistTemplateService.count(filterString));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user