some cleanup
This commit is contained in:
parent
246f13b7f6
commit
dc836137f2
@ -93,11 +93,9 @@ public abstract class CheckListTemplateDataPanel extends Panel {
|
||||
columns = new IColumn[4];
|
||||
}
|
||||
|
||||
|
||||
columns[0] = new ClickableTitleColumn<CheckListTemplate>(Model.of("Name"), "name", "name") {
|
||||
@Override
|
||||
protected void onClick(IModel<CheckListTemplate> clicked, AjaxRequestTarget target) {
|
||||
// System.out.println(clicked.getObject().getName());
|
||||
cltdp.onClick(clicked, target);
|
||||
}
|
||||
};
|
||||
@ -121,6 +119,7 @@ public abstract class CheckListTemplateDataPanel extends Panel {
|
||||
columns[4] = new ClickableDeleteColumn<CheckListTemplate>(Model.of("Delete"), "name") {
|
||||
@Override
|
||||
protected void onClick(IModel<CheckListTemplate> clicked, AjaxRequestTarget target) {
|
||||
//peer templates can be connected to peer requests and cannot be deleted
|
||||
boolean isPeer = false;
|
||||
for (ChecklistCategory clc : clicked.getObject().getCategories()){
|
||||
if (clc.getCategoryName().equalsIgnoreCase("peer")){
|
||||
@ -136,7 +135,6 @@ public abstract class CheckListTemplateDataPanel extends Panel {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
table = new DataTable<CheckListTemplate>("datatable", columns, checklistTemplateProvider = new ChecklistTemplateProvider(), 10);
|
||||
table.setOutputMarkupId(true);
|
||||
table.addBottomToolbar(navigationToolbar = new NavigationToolbar(table));
|
||||
@ -155,8 +153,6 @@ public abstract class CheckListTemplateDataPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public Iterator<? extends CheckListTemplate> iterator(int first, int count) {
|
||||
// Sort(Direction direction, String... properties)
|
||||
// new Sort(Sort.Direction.ASC, "name")
|
||||
Sort sort;
|
||||
if (getSort().isAscending()){
|
||||
sort = new Sort(Sort.Direction.ASC, getSort().getProperty());
|
||||
@ -164,10 +160,6 @@ public abstract class CheckListTemplateDataPanel extends Panel {
|
||||
else {
|
||||
sort = new Sort(Sort.Direction.DESC, getSort().getProperty());
|
||||
}
|
||||
// new Sort(Sort.Direction.ASC, getSort().toString())
|
||||
|
||||
//Changed from count to table.getRowsPerPage to make pagination work.
|
||||
//return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), count, sort)).iterator();
|
||||
return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), table.getRowsPerPage(), sort)).iterator();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user