Search in sources :

Example 11 with ConfirmationPanel

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

the class PageCertCampaigns method getDeleteCampaignConfirmationPanel.

private Popupable getDeleteCampaignConfirmationPanel() {
    return new ConfirmationPanel(getMainPopupBodyId(), createDeleteCampaignConfirmString()) {

        private static final long serialVersionUID = 1L;

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

        @Override
        public StringResourceModel getTitle() {
            return createStringResource("PageCertCampaigns.dialog.title.confirmDeleteCampaign");
        }
    };
}
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 12 with ConfirmationPanel

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

the class ResourceContentPanel method deleteResourceObjectPerformed.

// TODO: as a task?
protected void deleteResourceObjectPerformed(ShadowType selected, AjaxRequestTarget target) {
    final List<ShadowType> selectedShadow = getSelectedShadowsList(selected);
    final OperationResult result = new OperationResult(OPERATION_DELETE_OBJECT);
    if (selectedShadow == null || selectedShadow.isEmpty()) {
        result.recordWarning("Nothing selected to delete");
        getPageBase().showResult(result);
        target.add(getPageBase().getFeedbackPanel());
        return;
    }
    ConfirmationPanel dialog = new ConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString(selected, "pageContentAccounts.message.deleteConfirmation", "pageContentAccounts.message.deleteConfirmationSingle")) {

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

Example 13 with ConfirmationPanel

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

the class PageCreatedReports method getDeleteDialogPanel.

private ConfirmationPanel getDeleteDialogPanel() {
    ConfirmationPanel dialog = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), createDeleteConfirmString()) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            getPageBase().hideMainPopup(target);
            ReportDeleteDialogDto dto = deleteModel.getObject();
            switch(dto.getOperation()) {
                case DELETE_SINGLE:
                    deleteSelectedConfirmedPerformed(target, Arrays.asList(dto.getObjects().get(0)));
                    break;
                case DELETE_SELECTED:
                    deleteSelectedConfirmedPerformed(target, dto.getObjects());
                    break;
                case DELETE_ALL:
                    deleteAllConfirmedPerformed(target);
                    break;
            }
        }
    };
    return dialog;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ReportDeleteDialogDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportDeleteDialogDto) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)

Example 14 with ConfirmationPanel

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

the class TreeTablePanel method deleteNodePerformed.

private void deleteNodePerformed(final SelectableBean<OrgType> orgToDelete, AjaxRequestTarget target) {
    ConfirmationPanel confirmationPanel = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            if (hasChildren(orgToDelete)) {
                return createStringResource("TreeTablePanel.message.warn.deleteTreeObjectConfirm", WebComponentUtil.getEffectiveName(orgToDelete.getValue(), OrgType.F_DISPLAY_NAME)).getObject();
            }
            return createStringResource("TreeTablePanel.message.deleteTreeObjectConfirm", WebComponentUtil.getEffectiveName(orgToDelete.getValue(), OrgType.F_DISPLAY_NAME)).getObject();
        }
    }) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteNodeConfirmedPerformed(orgToDelete, target);
        }
    };
    confirmationPanel.setOutputMarkupId(true);
    getPageBase().showMainPopup(confirmationPanel, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)

Example 15 with ConfirmationPanel

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

the class OrgMemberPanel method deleteMemberPerformed.

private void deleteMemberPerformed(final QueryScope scope, final QName relation, final AjaxRequestTarget target, String confirmMessageKey) {
    ConfirmationPanel confirmDelete = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), createStringResource(confirmMessageKey)) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            OrgMemberPanel.this.deleteMemberConfirmPerformed(scope, relation, target);
        }
    };
    getPageBase().showMainPopup(confirmDelete, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)

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