Search in sources :

Example 1 with ObjectPolicyPanel

use of com.evolveum.midpoint.web.page.admin.configuration.component.ObjectPolicyPanel in project midpoint by Evolveum.

the class ObjectPolicyConfigurationEditor method editPerformed.

private void editPerformed(AjaxRequestTarget target, ListItem<ObjectPolicyConfigurationTypeDto> item) {
    ObjectPolicyPanel objectPolicyPanel = new ObjectPolicyPanel(getPageBase().getMainPopupBodyId(), item.getModelObject()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void savePerformed(AjaxRequestTarget target) {
            ObjectPolicyConfigurationTypeDto oldConfig = getModel().getObject().getConfig();
            ObjectPolicyConfigurationTypeDto newConfig = getModel().getObject().preparePolicyConfig();
            ObjectPolicyConfigurationEditor.this.replace(oldConfig, newConfig);
            ObjectPolicyConfigurationEditor.this.getPageBase().hideMainPopup(target);
            target.add(ObjectPolicyConfigurationEditor.this);
        }
    };
    objectPolicyPanel.setOutputMarkupId(true);
    getPageBase().showMainPopup(objectPolicyPanel, target);
//        ObjectPolicyPanel window = (ObjectPolicyPanel) get(ID_TEMPLATE_CONFIG_MODAL);
//        window.updateModel(target, (ObjectPolicyConfigurationTypeDto)item.getModelObject());
//        window.show(target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectPolicyPanel(com.evolveum.midpoint.web.page.admin.configuration.component.ObjectPolicyPanel) ObjectPolicyConfigurationTypeDto(com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectPolicyConfigurationTypeDto)

Aggregations

ObjectPolicyPanel (com.evolveum.midpoint.web.page.admin.configuration.component.ObjectPolicyPanel)1 ObjectPolicyConfigurationTypeDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectPolicyConfigurationTypeDto)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1