Search in sources :

Example 1 with Form

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

the class ProgressPanel method initButtons.

private void initButtons(final Form progressForm, final ProgressReportingAwarePage page) {
    AjaxSubmitButton abortButton = new AjaxSubmitButton(ID_ABORT, createStringResource("pageAdminFocus.button.abort")) {

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

        @Override
        protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            target.add(page.getFeedbackPanel());
        }
    };
    progressReporter.registerAbortButton(abortButton);
    progressForm.add(abortButton);
    AjaxSubmitButton backButton = new AjaxSubmitButton(ID_BACK, createStringResource("pageAdminFocus.button.back")) {

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

        @Override
        protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            target.add(page.getFeedbackPanel());
        }
    };
    progressReporter.registerBackButton(backButton);
    progressForm.add(backButton);
    AjaxSubmitButton continueEditingButton = new AjaxSubmitButton(ID_CONTINUE_EDITING, createStringResource("pageAdminFocus.button.continueEditing")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            ProgressReportingAwarePage page = (ProgressReportingAwarePage) getPage();
            page.continueEditing(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            target.add(page.getFeedbackPanel());
        }
    };
    progressReporter.registerContinueEditingButton(continueEditingButton);
    progressForm.add(continueEditingButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(com.evolveum.midpoint.web.component.form.Form)

Example 2 with Form

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

the class TaskMainPanel method initLayout.

private void initLayout() {
    Form mainForm = new Form<>(ID_MAIN_FORM, true);
    add(mainForm);
    initTabPanel(mainForm);
    initButtons(mainForm);
}
Also used : Form(com.evolveum.midpoint.web.component.form.Form)

Example 3 with Form

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

the class MultipleAssignmentSelectorPanel method initLayout.

private void initLayout(Class<H> targetFocusClass, PageBase page) {
    IModel<List<AssignmentEditorDto>> availableAssignmentModel = createAvailableAssignmentModel();
    final MultipleAssignmentSelector availableAssignmentsPanel = new MultipleAssignmentSelector<F, H>(ID_AVAILABLE_ASSIGNMENTS, availableAssignmentModel, targetFocusClass, type, focus, getFilterModel(true), page);
    final MultipleAssignmentSelector currentAssignmentsPanel = new MultipleAssignmentSelector<F, H>(ID_CURRENT_ASSIGNMENTS, assignmentsModel, targetFocusClass, type, null, getFilterModel(true), page) {

        @Override
        protected List<AssignmentEditorDto> getListProviderDataList() {
            return assignmentsModel.getObject();
        }
    };
    currentAssignmentsPanel.setFilterButtonVisibility(false);
    AjaxButton add = new AjaxButton(ID_BUTTON_ADD) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form form) {
            addToAssignmentsModel(target, availableAssignmentsPanel, currentAssignmentsPanel);
        }
    };
    AjaxButton remove = new AjaxButton(ID_BUTTON_REMOVE) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form form) {
            deleteFromAssignmentsModel(target, currentAssignmentsPanel, availableAssignmentsPanel);
        }
    };
    remove.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_UNASSIGN_ACTION_URL);
        }
    });
    AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            reset(currentAssignmentsPanel);
            target.add(currentAssignmentsPanel);
        }
    };
    buttonReset.setBody(createStringResource("MultipleAssignmentSelector.reset"));
    Form<?> form = new Form<Void>(ID_FORM);
    form.add(createTenantContainer());
    form.add(createOrgContainer());
    form.add(availableAssignmentsPanel);
    form.add(currentAssignmentsPanel);
    form.add(buttonReset);
    form.add(add);
    form.add(remove);
    add(form);
}
Also used : Form(com.evolveum.midpoint.web.component.form.Form) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(org.apache.wicket.ajax.markup.html.form.AjaxButton) ArrayList(java.util.ArrayList) List(java.util.List) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Example 4 with Form

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

the class PageSelfRegistration method updateCaptcha.

private void updateCaptcha(AjaxRequestTarget target) {
    CaptchaPanel captcha = new CaptchaPanel(ID_CAPTCHA);
    captcha.setOutputMarkupId(true);
    Form<?> form = (Form<?>) get(ID_MAIN_FORM);
    form.addOrReplace(captcha);
    target.add(form);
}
Also used : Form(com.evolveum.midpoint.web.component.form.Form) CaptchaPanel(com.evolveum.midpoint.gui.api.component.captcha.CaptchaPanel)

Example 5 with Form

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

the class PageSelfRegistration method initLayout.

private void initLayout() {
    final Form<?> mainForm = new Form<>(ID_MAIN_FORM);
    initAccessBehaviour(mainForm);
    add(mainForm);
    addMultilineLable(ID_WELCOME, "PageSelfRegistration.welcome.message", mainForm);
    addMultilineLable(ID_ADDITIONAL_TEXT, "PageSelfRegistration.additional.message", mainForm);
    initStaticFormLayout(mainForm);
    initDynamicFormLayout(mainForm);
    CaptchaPanel captcha = new CaptchaPanel(ID_CAPTCHA);
    captcha.setOutputMarkupId(true);
    mainForm.add(captcha);
    AjaxSubmitButton register = new AjaxSubmitButton(ID_SUBMIT_REGISTRATION) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            showErrors(target);
        }

        protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
            submitRegistration(target);
        }
    };
    mainForm.add(register);
    MultiLineLabel label = new MultiLineLabel(ID_REGISTRATION_SUBMITED, createStringResource("PageSelfRegistration.registration.confirm.message"));
    add(label);
    label.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return submited;
        }

        @Override
        public boolean isEnabled() {
            return submited;
        }
    });
    AjaxButton back = new AjaxButton(ID_BACK) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            setResponsePage(PageLogin.class);
        }
    };
    mainForm.add(back);
}
Also used : AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(com.evolveum.midpoint.web.component.form.Form) CaptchaPanel(com.evolveum.midpoint.gui.api.component.captcha.CaptchaPanel) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) MultiLineLabel(org.apache.wicket.markup.html.basic.MultiLineLabel)

Aggregations

Form (com.evolveum.midpoint.web.component.form.Form)16 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)12 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)9 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)7 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)6 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 CaptchaPanel (com.evolveum.midpoint.gui.api.component.captcha.CaptchaPanel)2 PrismContainerDefinition (com.evolveum.midpoint.prism.PrismContainerDefinition)2 ArrayList (java.util.ArrayList)2 TextArea (org.apache.wicket.markup.html.form.TextArea)2 CountableLoadableModel (com.evolveum.midpoint.gui.api.model.CountableLoadableModel)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 TabbedPanel (com.evolveum.midpoint.web.component.TabbedPanel)1 AssignmentDetailsPanel (com.evolveum.midpoint.web.component.assignment.AssignmentDetailsPanel)1 AssignmentEditorDto (com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto)1 AssignmentTablePanel (com.evolveum.midpoint.web.component.assignment.AssignmentTablePanel)1 TargetUserSelectorComponent (com.evolveum.midpoint.web.component.assignment.TargetUserSelectorComponent)1 DropDownChoicePanel (com.evolveum.midpoint.web.component.input.DropDownChoicePanel)1