Search in sources :

Example 1 with ConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.ConfirmationPanel in project midpoint by Evolveum.

the class DefinitionStagesPanel method deletePerformed.

private void deletePerformed(AjaxRequestTarget target) {
    ConfirmationPanel dialog = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            StageDefinitionDto dto = getModelObject().get(tabPanel.getSelectedTab());
            return getString("DefinitionStagesPanel.confirmDeleteText", dto.getName());
        }
    }) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            getPageBase().hideMainPopup(target);
            deleteConfirmedPerformed(target);
        }
    };
    getPageBase().showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) StageDefinitionDto(com.evolveum.midpoint.web.page.admin.certification.dto.StageDefinitionDto) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)

Example 2 with ConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.ConfirmationPanel in project midpoint by Evolveum.

the class PageConnectorHosts method deleteHostPerformed.

private void deleteHostPerformed(AjaxRequestTarget target) {
    List<SelectableBean<ConnectorHostType>> selected = WebComponentUtil.getSelectedData(getConnectorHostTable());
    if (selected.isEmpty()) {
        warn(getString("pageResources.message.noHostSelected"));
        target.add(getFeedbackPanel());
        return;
    }
    ConfirmationPanel dialog = new ConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString("pageResources.message.deleteHostConfirm", "pageResources.message.deleteHostsConfirm", false)) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            ((PageBase) getPage()).hideMainPopup(target);
            deleteHostConfirmedPerformed(target);
        }
    };
    ((PageBase) getPage()).showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 3 with ConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.ConfirmationPanel in project midpoint by Evolveum.

the class PageResources method deleteResourcePerformed.

private void deleteResourcePerformed(AjaxRequestTarget target, ResourceType single) {
    List<ResourceType> selected = isAnyResourceSelected(target, single);
    singleDelete = single;
    if (selected.isEmpty()) {
        return;
    }
    ConfirmationPanel dialog = new ConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString("pageResources.message.deleteResourceConfirm", "pageResources.message.deleteResourcesConfirm", true)) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            ((PageBase) getPage()).hideMainPopup(target);
            deleteResourceConfirmedPerformed(target);
        }
    };
    ((PageBase) getPage()).showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 4 with ConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.ConfirmationPanel in project midpoint by Evolveum.

the class AssignmentTablePanel method getDeleteAssignmentPopupContent.

private Popupable getDeleteAssignmentPopupContent() {
    return new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return getAssignmentsDeleteMessage(getSelectedAssignments().size());
        }
    }) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            ModalWindow modalWindow = findParent(ModalWindow.class);
            if (modalWindow != null) {
                modalWindow.close(target);
                deleteAssignmentConfirmedPerformed(target, getSelectedAssignments());
                reloadMainFormButtons(target);
            }
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Example 5 with ConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.ConfirmationPanel in project midpoint by Evolveum.

the class PageCertCampaigns method getCloseCampaignConfirmationPanel.

private Popupable getCloseCampaignConfirmationPanel() {
    return new ConfirmationPanel(getMainPopupBodyId(), createCloseCampaignConfirmString()) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            ModalWindow modalWindow = findParent(ModalWindow.class);
            if (modalWindow != null) {
                modalWindow.close(target);
                closeCampaignConfirmedPerformed(target, relevantCampaign);
            }
        }

        @Override
        public StringResourceModel getTitle() {
            return createStringResource("PageCertCampaigns.dialog.title.confirmCloseCampaign");
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Aggregations

ConfirmationPanel (com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)18 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)18 ModalWindow (org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)10 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)1 StageDefinitionDto (com.evolveum.midpoint.web.page.admin.certification.dto.StageDefinitionDto)1 ReportDeleteDialogDto (com.evolveum.midpoint.web.page.admin.reports.dto.ReportDeleteDialogDto)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)1