Search in sources :

Example 6 with ModalWindow

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

the class ResourceAttributeEditor method initModals.

private void initModals(NonEmptyModel<Boolean> readOnlyModel) {
    ModalWindow limitationsEditor = new LimitationsEditorDialog(ID_MODAL_LIMITATIONS, new PropertyModel<List<PropertyLimitationsType>>(getModel(), "limitations"), readOnlyModel);
    add(limitationsEditor);
    ModalWindow inboundEditor = new MappingEditorDialog(ID_MODAL_INBOUND, null, readOnlyModel) {

        @Override
        public void updateComponents(AjaxRequestTarget target) {
            target.add(ResourceAttributeEditor.this.get(ID_INBOUND), parentStep.getAttributeList());
        }
    };
    add(inboundEditor);
    ModalWindow outboundEditor = new MappingEditorDialog(ID_MODAL_OUTBOUND, null, readOnlyModel) {

        @Override
        public void updateComponents(AjaxRequestTarget target) {
            target.add(ResourceAttributeEditor.this.get(ID_OUTBOUND_LABEL), ResourceAttributeEditor.this.get(ID_BUTTON_OUTBOUND), parentStep.getAttributeList());
        }
    };
    add(outboundEditor);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) LimitationsEditorDialog(com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.LimitationsEditorDialog) MappingEditorDialog(com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.MappingEditorDialog) List(java.util.List) ArrayList(java.util.ArrayList) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Example 7 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow 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 8 with ModalWindow

use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow 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)

Example 9 with ModalWindow

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

the class PageAccounts method initLayout.

private void initLayout() {
    Form form = new Form(ID_MAIN_FORM);
    form.setOutputMarkupId(true);
    add(form);
    Form accForm = new Form(ID_FORM_ACCOUNT);
    accForm.setOutputMarkupId(true);
    add(accForm);
    Form searchForm = new Form(ID_SEARCH_FORM);
    initSearchForm(searchForm);
    searchForm.setOutputMarkupPlaceholderTag(true);
    searchForm.setOutputMarkupId(true);
    searchForm.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return resourceModel.getObject() != null;
        }
    });
    add(searchForm);
    DropDownChoice<ResourceItemDto> resources = new DropDownChoice<>(ID_RESOURCES, resourceModel, resourcesModel, new ChoiceableChoiceRenderer<ResourceItemDto>());
    form.add(resources);
    initLinks(form, accForm);
    initTotals(form);
    final AjaxDownloadBehaviorFromFile ajaxDownloadBehavior = new AjaxDownloadBehaviorFromFile(true) {

        @Override
        protected File initFile() {
            return downloadFile;
        }
    };
    ajaxDownloadBehavior.setRemoveFile(false);
    form.add(ajaxDownloadBehavior);
    WebMarkupContainer filesContainer = new WebMarkupContainer(ID_FILES_CONTAINER);
    filesContainer.setOutputMarkupId(true);
    accForm.add(filesContainer);
    ModalWindow resultPopup = createModalWindow(ID_RESULT_DIALOG, createStringResource("PageAccounts.result.popoup"), 1100, 560);
    resultPopup.setContent(new AceEditorDialog(resultPopup.getContentId()));
    add(resultPopup);
    filesModel = createFilesModel();
    ListView<String> files = new ListView<String>(ID_FILES, filesModel) {

        @Override
        protected void populateItem(final ListItem<String> item) {
            AjaxLink file = new AjaxLink(ID_FILE) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    downloadPerformed(target, item.getModelObject(), ajaxDownloadBehavior);
                }
            };
            file.add(new Label(ID_FILE_NAME, item.getModelObject()));
            item.add(file);
        }
    };
    files.setRenderBodyOnly(true);
    filesContainer.add(files);
    WebMarkupContainer accountsContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
    accountsContainer.setOutputMarkupId(true);
    accForm.add(accountsContainer);
    ObjectDataProvider provider = new ObjectDataProvider(this, ShadowType.class);
    provider.setOptions(SelectorOptions.createCollection(GetOperationOptions.createRaw()));
    provider.setQuery(ObjectQuery.createObjectQuery(createResourceQueryFilter()));
    TablePanel accounts = new TablePanel(ID_ACCOUNTS, provider, createAccountsColumns(), UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS, getItemsPerPage(UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS));
    accounts.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return resourceModel.getObject() != null;
        }
    });
    accounts.setItemsPerPage(50);
    accountsContainer.add(accounts);
}
Also used : Form(org.apache.wicket.markup.html.form.Form) AjaxDownloadBehaviorFromFile(com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile) Label(org.apache.wicket.markup.html.basic.Label) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) ResourceItemDto(com.evolveum.midpoint.web.page.admin.configuration.dto.ResourceItemDto) ListView(org.apache.wicket.markup.html.list.ListView) AceEditorDialog(com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ListItem(org.apache.wicket.markup.html.list.ListItem) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 10 with ModalWindow

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

the class PageAccounts method showShadowResult.

private void showShadowResult(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
    OperationResultType result = getResult(rowModel);
    String xml;
    ModalWindow aceDialog = (ModalWindow) get(createComponentPath(ID_RESULT_DIALOG));
    AceEditorDialog aceEditor = (AceEditorDialog) aceDialog.get(aceDialog.getContentId());
    try {
        xml = getPrismContext().xmlSerializer().serializeRealValue(result, ShadowType.F_RESULT);
        aceEditor.updateModel(new Model<String>(xml));
    } catch (SchemaException e) {
        LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse result", e);
        aceEditor.updateModel(new Model<String>("Unable to show result. For more information see logs."));
    }
    aceDialog.show(target);
    target.add(getFeedbackPanel());
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) AceEditorDialog(com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) IModel(org.apache.wicket.model.IModel) Model(org.apache.wicket.model.Model) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) PropertyModel(org.apache.wicket.model.PropertyModel) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) 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