Search in sources :

Example 26 with AjaxSubmitButton

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

the class PageDebugView method initButtons.

private void initButtons(final MidpointForm<?> mainForm) {
    AjaxSubmitButton saveButton = new AjaxSubmitButton("saveButton", createStringResource("pageDebugView.button.save")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            savePerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getFeedbackPanel());
        }
    };
    mainForm.add(saveButton);
    AjaxButton backButton = new AjaxButton("backButton", createStringResource("pageDebugView.button.back")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            redirectBack();
        }
    };
    mainForm.add(backButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton)

Example 27 with AjaxSubmitButton

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

the class PageImportObject method initButtons.

private void initButtons(WebMarkupContainer buttonBar, IModel<Integer> inputType) {
    AjaxButton backButton = new AjaxButton(ID_BACK_BUTTON, createStringResource("PageCertCampaign.button.back")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            redirectBack();
        }
    };
    backButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return canRedirectBack();
        }
    });
    buttonBar.add(backButton);
    AjaxSubmitButton saveFileButton = new AjaxSubmitButton(ID_IMPORT_FILE_BUTTON, createStringResource("PageImportObject.button.import")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            savePerformed(false, OPERATION_IMPORT_FILE, target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getFeedbackPanel());
        }
    };
    addVisibileForInputType(saveFileButton, INPUT_FILE, inputType);
    buttonBar.add(saveFileButton);
    AjaxSubmitButton saveXmlButton = new AjaxSubmitButton(ID_IMPORT_XML_BUTTON, createStringResource("PageImportObject.button.import")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            String operation = OPERATION_IMPORT + "." + dataLanguage;
            savePerformed(true, operation, target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getFeedbackPanel());
        }
    };
    addVisibileForInputType(saveXmlButton, INPUT_XML, inputType);
    buttonBar.add(saveXmlButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Example 28 with AjaxSubmitButton

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

the class InternalsClockPanel method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    setOutputMarkupId(true);
    Form form = new MidpointForm<>(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    DatePanel offset = new DatePanel(ID_OFFSET, getModel());
    form.add(offset);
    AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("PageInternals.button.changeTime")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            savePerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    form.add(saveButton);
    AjaxSubmitButton resetButton = new AjaxSubmitButton(ID_BUTTON_RESET, createStringResource("PageInternals.button.resetTimeChange")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            resetPerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    form.add(resetButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) DatePanel(com.evolveum.midpoint.web.component.input.DatePanel) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Example 29 with AjaxSubmitButton

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

the class AbstractSearchItemPanel method initLayout.

protected void initLayout() {
    setOutputMarkupId(true);
    WebMarkupContainer searchItemContainer = new WebMarkupContainer(ID_SEARCH_ITEM_CONTAINER);
    searchItemContainer.setOutputMarkupId(true);
    add(searchItemContainer);
    IModel<String> labelModel = createLabelModel();
    Label searchItemLabel = new Label(ID_SEARCH_ITEM_LABEL, labelModel);
    searchItemLabel.setOutputMarkupId(true);
    searchItemLabel.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(labelModel.getObject())));
    IModel<String> titleModel = createTitleModel();
    if (StringUtils.isNotEmpty(titleModel.getObject())) {
        searchItemLabel.add(AttributeAppender.append("title", titleModel));
    }
    searchItemContainer.add(searchItemLabel);
    Label help = new Label(ID_HELP);
    IModel<String> helpModel = createHelpModel();
    help.add(AttributeModifier.replace("title", createStringResource(helpModel.getObject() != null ? helpModel.getObject() : "")));
    help.add(new InfoTooltipBehavior() {

        @Override
        public String getDataPlacement() {
            return "left";
        }
    });
    // help.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(helpModel.getObject())));
    searchItemContainer.add(help);
    initSearchItemField(searchItemContainer);
    AjaxSubmitButton removeButton = new AjaxSubmitButton(ID_REMOVE_BUTTON) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit(AjaxRequestTarget target) {
            deletePerformed(target);
        }
    };
    removeButton.add(new VisibleBehaviour(() -> canRemoveSearchItem()));
    removeButton.setOutputMarkupId(true);
    searchItemContainer.add(removeButton);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 30 with AjaxSubmitButton

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

the class TaskMainPanel method initLayoutSaveAndRunButton.

protected void initLayoutSaveAndRunButton() {
    AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE_AND_RUN, getDetailsPage().createStringResource("TaskMainPanel.button.saveAndRun")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            ((PageTask) getDetailsPage()).saveAndRunPerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getDetailsPage().getFeedbackPanel());
        }
    };
    saveButton.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return !getObjectWrapper().isReadOnly() && !getDetailsPage().isForcedPreview();
        }

        @Override
        public boolean isEnabled() {
            return !ItemStatus.NOT_CHANGED.equals(getObjectWrapper().getStatus()) || getObjectWrapper().canModify();
        }
    });
    saveButton.setOutputMarkupId(true);
    saveButton.setOutputMarkupPlaceholderTag(true);
    getMainForm().add(saveButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Aggregations

AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)67 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)65 Form (org.apache.wicket.markup.html.form.Form)27 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)23 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)23 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)20 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)12 ArrayList (java.util.ArrayList)9 List (java.util.List)8 Label (org.apache.wicket.markup.html.basic.Label)8 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)7 ListItem (org.apache.wicket.markup.html.list.ListItem)5 CheckFormGroup (com.evolveum.midpoint.web.component.form.CheckFormGroup)4 AceEditor (com.evolveum.midpoint.web.component.AceEditor)3 Form (com.evolveum.midpoint.web.component.form.Form)3 QNameChoiceRenderer (com.evolveum.midpoint.web.component.input.QNameChoiceRenderer)3 TextPanel (com.evolveum.midpoint.web.component.input.TextPanel)3 FeedbackAlerts (com.evolveum.midpoint.web.component.message.FeedbackAlerts)3 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3