Search in sources :

Example 21 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.

the class AssociationValueChoicePanel method initUserOrgDialog.

private void initUserOrgDialog() {
    final ModalWindow dialog = new ModalWindow(MODAL_ID_OBJECT_SELECTION_POPUP);
    ObjectSelectionPanel.Context context = new ObjectSelectionPanel.Context(this) {

        private static final long serialVersionUID = 1L;

        // See analogous discussion in ChooseTypePanel
        public AssociationValueChoicePanel getRealParent() {
            return WebComponentUtil.theSameForPage(AssociationValueChoicePanel.this, getCallingPageReference());
        }

        @Override
        public void chooseOperationPerformed(AjaxRequestTarget target, ObjectType object) {
            getRealParent().choosePerformed(target, object);
        }

        @Override
        public boolean isSearchEnabled() {
            return true;
        }

        @Override
        public Class<? extends ObjectType> getObjectTypeClass() {
            return UserType.class;
        }

        @Override
        protected WebMarkupContainer createExtraContentContainer(String extraContentId, final ObjectSelectionPanel objectSelectionPanel) {
            return new UserOrgReferenceChoosePanel(extraContentId, Boolean.FALSE) {

                @Override
                protected void onReferenceTypeChangePerformed(AjaxRequestTarget target, Boolean newValue) {
                    objectSelectionPanel.updateTableByTypePerformed(target, Boolean.FALSE.equals(newValue) ? UserType.class : OrgType.class);
                }
            };
        }
    };
    ObjectSelectionPage.prepareDialog(dialog, context, this, "chooseTypeDialog.title", ID_TEXT_WRAPPER);
    add(dialog);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectSelectionPanel(com.evolveum.midpoint.web.page.admin.configuration.component.ObjectSelectionPanel) UserOrgReferenceChoosePanel(com.evolveum.midpoint.web.page.admin.roles.component.UserOrgReferenceChoosePanel) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Example 22 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.

the class AssignmentTablePanel method addSelectedAssignablePerformed.

protected void addSelectedAssignablePerformed(AjaxRequestTarget target, List<ObjectType> newAssignments, String popupId) {
    ModalWindow window = (ModalWindow) get(popupId);
    if (window != null) {
        window.close(target);
    }
    getPageBase().hideMainPopup(target);
    if (newAssignments.isEmpty()) {
        warn(getNoAssignmentsSelectedMessage());
        target.add(getPageBase().getFeedbackPanel());
        return;
    }
    List<AssignmentEditorDto> assignments = getAssignmentModel().getObject();
    for (ObjectType object : newAssignments) {
        try {
            if (object instanceof ResourceType) {
                addSelectedResourceAssignPerformed((ResourceType) object);
                continue;
            }
            if (object instanceof UserType) {
                AssignmentEditorDto dto = AssignmentEditorDto.createDtoAddFromSelectedObject(object, SchemaConstants.ORG_DEPUTY, getPageBase());
                assignments.add(dto);
            } else {
                AssignmentEditorDto dto = AssignmentEditorDto.createDtoAddFromSelectedObject(object, getPageBase());
                assignments.add(dto);
            }
        } catch (Exception e) {
            error(getString("AssignmentTablePanel.message.couldntAssignObject", object.getName(), e.getMessage()));
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't assign object", e);
        }
    }
    reloadAssignmentsPanel(target);
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) SchemaException(com.evolveum.midpoint.util.exception.SchemaException)

Example 23 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.

the class ResourceActivationEditor method initModals.

private void initModals(NonEmptyModel<Boolean> readOnlyModel) {
    ModalWindow mappingEditor = new MappingEditorDialog(ID_MODAL_MAPPING, null, readOnlyModel) {

        @Override
        public void updateComponents(AjaxRequestTarget target) {
            target.add(ResourceActivationEditor.this);
        }
    };
    add(mappingEditor);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) MappingEditorDialog(com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.MappingEditorDialog) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Example 24 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.

the class ResourceIterationEditor method initModals.

private void initModals() {
    ModalWindow variableEditor = new ExpressionVariableEditorDialog(ID_VARIABLE_EDITOR_MODAL, null) {

        @Override
        public void updateComponents(AjaxRequestTarget target) {
            target.add(ResourceIterationEditor.this.get(ID_POST_VARIABLE_LIST), ResourceIterationEditor.this.get(ID_PRE_VARIABLE_LIST), ResourceIterationEditor.this.get(ID_TOKEN_VARIABLE_LIST));
        }
    };
    add(variableEditor);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ExpressionVariableEditorDialog(com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.ExpressionVariableEditorDialog) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Example 25 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.

the class FocusProjectionsTabPanel method getDeleteProjectionPopupContent.

private Popupable getDeleteProjectionPopupContent() {
    ConfirmationPanel dialog = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return createStringResource("pageAdminFocus.message.deleteAccountConfirm", getSelectedProjections(projectionModel).size()).getString();
        }
    }) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            ModalWindow modalWindow = findParent(ModalWindow.class);
            if (modalWindow != null) {
                modalWindow.close(target);
                deleteAccountConfirmedPerformed(target, getSelectedProjections(projectionModel));
            }
        }
    };
    return dialog;
}
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

ModalWindow (org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)28 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)23 ConfirmationPanel (com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)10 MappingEditorDialog (com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.MappingEditorDialog)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 LimitationsEditorDialog (com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.LimitationsEditorDialog)2 AceEditorDialog (com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog)2 ObjectSelectionPanel (com.evolveum.midpoint.web.page.admin.configuration.component.ObjectSelectionPanel)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)2 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)2 Label (org.apache.wicket.markup.html.basic.Label)2 ListItem (org.apache.wicket.markup.html.list.ListItem)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 ObjectBrowserPanel (com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1