Commit 57217115 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Enactment Engine table now updates when adding a new EE

parent 23983038
...@@ -25,6 +25,7 @@ import org.apache.syncope.client.console.panels.EnactmentEngineDirectoryPanel; ...@@ -25,6 +25,7 @@ import org.apache.syncope.client.console.panels.EnactmentEngineDirectoryPanel;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.Model; import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.mapper.parameter.PageParameters;
...@@ -39,19 +40,18 @@ public class EnactmentEnginePage extends BaseExtPage { ...@@ -39,19 +40,18 @@ public class EnactmentEnginePage extends BaseExtPage {
private final BaseModal<Serializable> utilityModal = new BaseModal<>("addEnactmentModal"); private final BaseModal<Serializable> utilityModal = new BaseModal<>("addEnactmentModal");
private final WebMarkupContainer content;
public EnactmentEnginePage(final PageParameters parameters) { public EnactmentEnginePage(final PageParameters parameters) {
super(parameters); super(parameters);
body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class)); body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
WebMarkupContainer content = new WebMarkupContainer("content"); content = new WebMarkupContainer("content");
content.setOutputMarkupId(true); content.setOutputMarkupId(true);
content.add(new EnactmentEngineDirectoryPanel("enactmentengines", getPageReference())); content.add(new EnactmentEngineDirectoryPanel("enactmentengines", getPageReference()));
utilityModal.size(Modal.Size.Large);
utilityModal.addSubmitButton();
content.add(new AjaxLink("addLink") { content.add(new AjaxLink("addLink") {
private static final long serialVersionUID = 4879178530891785513L; private static final long serialVersionUID = 4879178530891785513L;
...@@ -65,15 +65,28 @@ public class EnactmentEnginePage extends BaseExtPage { ...@@ -65,15 +65,28 @@ public class EnactmentEnginePage extends BaseExtPage {
} }
}); });
body.add(utilityModal); utilityModal.size(Modal.Size.Large);
utilityModal.addSubmitButton();
utilityModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = -4920274615194015386L;
@Override
public void onClose(final AjaxRequestTarget target) {
target.add(getEEDirectoryPanel());
target.add(content);
utilityModal.show(false);
}
});
body.add(utilityModal);
body.add(content); body.add(content);
body.setOutputMarkupId(true);
} }
@Override private EnactmentEngineDirectoryPanel getEEDirectoryPanel() {
public void setWindowClosedCallback(final BaseModal<?> modal, final WebMarkupContainer container) { return new EnactmentEngineDirectoryPanel("enactmentengines", getPageReference());
this.renderPage();
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment