Search in sources :

Example 1 with TestConnectionResultPanel

use of com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel in project midpoint by Evolveum.

the class ConfigurationStep method testConnectionPerformed.

// copied from PageResource, TODO deduplicate
private void testConnectionPerformed(AjaxRequestTarget target) {
    parentPage.refreshIssues(null);
    if (parentPage.isReadOnly() || !isComplete()) {
        return;
    }
    saveChanges();
    PageBase page = getPageBase();
    TestConnectionResultPanel testConnectionPanel = new TestConnectionResultPanel(page.getMainPopupBodyId(), resourceModelNoFetch.getObject().getOid(), getPage());
    testConnectionPanel.setOutputMarkupId(true);
    page.showMainPopup(testConnectionPanel, target);
    //		page.showResult(result, "Test connection failed", false);
    target.add(page.getFeedbackPanel());
    target.add(getForm());
}
Also used : TestConnectionResultPanel(com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 2 with TestConnectionResultPanel

use of com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel in project midpoint by Evolveum.

the class PageResource method testConnectionPerformed.

private void testConnectionPerformed(AjaxRequestTarget target) {
    final PrismObject<ResourceType> dto = resourceModel.getObject();
    if (dto == null || StringUtils.isEmpty(dto.getOid())) {
        error(getString("pageResource.message.oidNotDefined"));
        target.add(getFeedbackPanel());
        return;
    }
    final TestConnectionResultPanel testConnectionPanel = new TestConnectionResultPanel(getMainPopupBodyId(), dto.getOid(), getPage()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void okPerformed(AjaxRequestTarget target) {
            refreshStatus(target);
        }
    };
    testConnectionPanel.setOutputMarkupId(true);
    getMainPopup().setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean onCloseButtonClicked(AjaxRequestTarget target) {
            return false;
        }
    });
    showMainPopup(testConnectionPanel, target);
//        if (!testConnectionPanel.isFocusSet()) {
//            testConnectionPanel.setFocusSet(true);
//            testConnectionPanel.setFocusOnComponent(testConnectionPanel.getOkButton(), target);
//        }
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) TestConnectionResultPanel(com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Aggregations

TestConnectionResultPanel (com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 ModalWindow (org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)1