working on exemptions page, need to create wrapper panel for adding ajaxcheckbox to column
This commit is contained in:
parent
9a61973fa2
commit
d4c10ee6bb
resources/db_update_scripts
src/main/java/se/su/dsv/scipro
@ -1 +1,2 @@
|
||||
ALTER TABLE `final_seminar` ADD `deleted` tinyint(1) NOT NULL;
|
||||
ALTER TABLE `final_seminar` ADD `deleted` tinyint(1) NOT NULL;
|
||||
ALTER TABLE `project` ADD `fs_rule_exmpt` bit(1) NOT NULL DEFAULT b'0';
|
@ -72,11 +72,11 @@ public class AdminFinalSeminarExemptionPage extends AbstractAdminPage {
|
||||
});
|
||||
getColumns().add(new AbstractColumn<Project>(Model.of("Exempted from final seminar rules")) {
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Project>> item, String s, IModel<Project> iModel) {
|
||||
item.add(new AjaxCheckBox(s, new Model<Boolean>(boolean here)) {
|
||||
public void populateItem(Item<ICellPopulator<Project>> item, String s, final IModel<Project> iModel) {
|
||||
item.add(new AjaxCheckBox(s, new Model<Boolean>(iModel.getObject().isFinalSeminarRuleExempted())) {
|
||||
@Override
|
||||
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
iModel.setObject(projectService.save(iModel.getObject()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -101,6 +101,9 @@ public class Project extends DomainObject implements Comparable<Project>, Iconiz
|
||||
@Column(length = 255)
|
||||
private String externalOrganization;
|
||||
|
||||
@Column(name = "fs_rule_exmpt")
|
||||
private boolean finalSeminarRuleExempted = false;
|
||||
|
||||
public Project() {}
|
||||
|
||||
public Long getId() {
|
||||
@ -404,4 +407,11 @@ public class Project extends DomainObject implements Comparable<Project>, Iconiz
|
||||
return externalOrganization != null;
|
||||
}
|
||||
|
||||
public boolean isFinalSeminarRuleExempted() {
|
||||
return finalSeminarRuleExempted;
|
||||
}
|
||||
|
||||
public void setFinalSeminarRuleExempted(boolean finalSeminarRuleExempted) {
|
||||
this.finalSeminarRuleExempted = finalSeminarRuleExempted;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user