hooked up edit panel
This commit is contained in:
parent
9cc6cd4be4
commit
aa8c53c2de
src/main/java/se/su/dsv/scipro/admin/pages
@ -8,6 +8,10 @@
|
||||
<wicket:extend>
|
||||
<div class="span-24 last">
|
||||
|
||||
<div wicket:id="dialog">
|
||||
<div wicket:id="editpanel"></div>
|
||||
</div>
|
||||
|
||||
<!--<div wicket:id="listCLPanel"></div>-->
|
||||
<div wicket:id="datapanel"></div>
|
||||
|
||||
|
@ -3,7 +3,11 @@ package se.su.dsv.scipro.admin.pages;
|
||||
import org.apache.wicket.PageParameters;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.markup.html.panel.EmptyPanel;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.odlabs.wiquery.ui.dialog.Dialog;
|
||||
import se.su.dsv.scipro.checklists.panels.FunctionalEditChecklistTemplatePanel;
|
||||
import se.su.dsv.scipro.checklists.panels.FunctionalListCheckListTemplatePanel;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListTemplate;
|
||||
import se.su.dsv.scipro.datatables.checklist.CheckListTemplateDataPanel;
|
||||
import se.su.dsv.scipro.security.auth.Authorization;
|
||||
@ -11,26 +15,48 @@ import se.su.dsv.scipro.security.auth.roles.Roles;
|
||||
|
||||
/**
|
||||
* @author Fredrik Norberg - fnorbe@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Authorization(authorizedRoles={Roles.SYSADMIN, Roles.ADMIN})
|
||||
@Authorization(authorizedRoles = {Roles.SYSADMIN, Roles.ADMIN})
|
||||
public class AdminCheckListPage extends AbstractAdminPage {
|
||||
|
||||
|
||||
public static final String MAIN_MENU_LABEL = "CheckLists";
|
||||
|
||||
public AdminCheckListPage(PageParameters pp) {
|
||||
super(pp);
|
||||
|
||||
public static final String MAIN_MENU_LABEL = "CheckLists";
|
||||
private Dialog dialog;
|
||||
private CheckListTemplateDataPanel cltdp;
|
||||
|
||||
public AdminCheckListPage(PageParameters pp) {
|
||||
super(pp);
|
||||
|
||||
// add(new AdminListCheckListTemplatePanel("listCLPanel", pp, CheckListRole.ADMIN));
|
||||
add(new CheckListTemplateDataPanel("datapanel", true) {
|
||||
|
||||
|
||||
dialog = new Dialog("dialog");
|
||||
dialog.setModal(true);
|
||||
dialog.setAutoOpen(false);
|
||||
dialog.setWidth(550);
|
||||
dialog.setHeight(700);
|
||||
dialog.add(new EmptyPanel("editpanel"));
|
||||
add(dialog);
|
||||
|
||||
|
||||
add(cltdp = new CheckListTemplateDataPanel("datapanel", true) {
|
||||
@Override
|
||||
public void onClick(IModel<CheckListTemplate> clicked, AjaxRequestTarget target) {
|
||||
System.out.println(clicked.getObject().getCreator());
|
||||
dialog.replace(new FunctionalEditChecklistTemplatePanel("editpanel", clicked.getObject()) {
|
||||
@Override
|
||||
public void onUpdate(AjaxRequestTarget target) {
|
||||
dialog.close(target);
|
||||
target.addComponent(cltdp);
|
||||
}
|
||||
});
|
||||
target.addComponent(dialog);
|
||||
dialog.open(target);
|
||||
}
|
||||
});
|
||||
cltdp.setOutputMarkupId(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user