Search in sources :

Example 66 with AjaxButton

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

the class PageAbout method initButtons.

private void initButtons() {
    AjaxButton testRepository = new AjaxButton(ID_TEST_REPOSITORY, createStringResource("PageAbout.button.testRepository")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            testRepositoryPerformed(target);
        }
    };
    add(testRepository);
    AjaxButton testRepositoryCheckOrgClosure = new AjaxButton(ID_TEST_REPOSITORY_CHECK_ORG_CLOSURE, createStringResource("PageAbout.button.testRepositoryCheckOrgClosure")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            testRepositoryCheckOrgClosurePerformed(target);
        }
    };
    add(testRepositoryCheckOrgClosure);
    AjaxButton reindexRepositoryObjects = new AjaxButton(ID_REINDEX_REPOSITORY_OBJECTS, createStringResource("PageAbout.button.reindexRepositoryObjects")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            reindexRepositoryObjectsPerformed(target);
        }
    };
    add(reindexRepositoryObjects);
    AjaxButton testProvisioning = new AjaxButton(ID_TEST_PROVISIONING, createStringResource("PageAbout.button.testProvisioning")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            testProvisioningPerformed(target);
        }
    };
    add(testProvisioning);
    AjaxButton cleanupActivitiProcesses = new AjaxButton(ID_CLEANUP_ACTIVITI_PROCESSES, createStringResource("PageAbout.button.cleanupActivitiProcesses")) {

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

Example 67 with AjaxButton

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

the class TaskMainPanel method initButtons.

private void initButtons(Form mainForm) {
    WebMarkupContainer buttonPanel = new WebMarkupContainer(ID_BUTTON_PANEL);
    buttonPanel.setOutputMarkupId(true);
    mainForm.add(buttonPanel);
    final TaskButtonsVisibility visibility = new TaskButtonsVisibility();
    AjaxButton backButton = new AjaxButton(ID_BACK, parentPage.createStringResource("pageTaskEdit.button.back")) {

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

        @Override
        public boolean isVisible() {
            return visibility.computeBackVisible(parentPage);
        }
    });
    buttonPanel.add(backButton);
    AjaxButton cancelEditingButton = new AjaxButton(ID_CANCEL_EDITING, parentPage.createStringResource("pageTaskEdit.button.cancelEditing")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.getController().cancelEditingPerformed(target);
        }
    };
    cancelEditingButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeCancelEditVisible(parentPage);
        }
    });
    buttonPanel.add(cancelEditingButton);
    AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE, parentPage.createStringResource("pageTaskEdit.button.save")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            parentPage.getController().savePerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            target.add(parentPage.getFeedbackPanel());
        }
    };
    saveButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeSaveVisible(parentPage);
        }
    });
    mainForm.setDefaultButton(saveButton);
    buttonPanel.add(saveButton);
    AjaxButton editButton = new AjaxButton(ID_EDIT, parentPage.createStringResource("pageTaskEdit.button.edit")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.setEdit(true);
            // stops refreshing as well
            parentPage.refresh(target);
            target.add(getMainForm());
        }
    };
    editButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeEditVisible(parentPage);
        }
    });
    buttonPanel.add(editButton);
    AjaxButton suspend = new AjaxButton(ID_SUSPEND, parentPage.createStringResource("pageTaskEdit.button.suspend")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.getController().suspendPerformed(target);
        }
    };
    suspend.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeSuspendVisible(parentPage);
        }
    });
    buttonPanel.add(suspend);
    AjaxButton resume = new AjaxButton(ID_RESUME, parentPage.createStringResource("pageTaskEdit.button.resume")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.getController().resumePerformed(target);
        }
    };
    resume.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeResumeVisible(parentPage);
        }
    });
    buttonPanel.add(resume);
    AjaxButton runNow = new AjaxButton(ID_RUN_NOW, parentPage.createStringResource("pageTaskEdit.button.runNow")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.getController().runNowPerformed(target);
        }
    };
    runNow.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeRunNowVisible(parentPage);
        }
    });
    buttonPanel.add(runNow);
    AjaxButton stopApproval = new AjaxButton(ID_STOP_APPROVAL, parentPage.createStringResource("pageTaskEdit.button.stopApprovalProcess")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            parentPage.getController().stopApprovalProcessPerformed(target);
        }
    };
    stopApproval.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return visibility.computeStopVisible(parentPage);
        }
    });
    buttonPanel.add(stopApproval);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) Form(com.evolveum.midpoint.web.component.form.Form) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)67 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)65 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)26 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)20 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)18 Form (org.apache.wicket.markup.html.form.Form)13 Label (org.apache.wicket.markup.html.basic.Label)12 ArrayList (java.util.ArrayList)11 List (java.util.List)10 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)7 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)7 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)7 Form (com.evolveum.midpoint.web.component.form.Form)6 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)6 AjaxRequestAttributes (org.apache.wicket.ajax.attributes.AjaxRequestAttributes)4 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)4 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)4 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)4 TextArea (org.apache.wicket.markup.html.form.TextArea)4 BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)3