Search in sources :

Example 1 with MidpointForm

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

the class PageSizePopover method initLayout.

protected void initLayout() {
    Button popButton = new Button(ID_POP_BUTTON);
    popButton.setOutputMarkupId(true);
    add(popButton);
    WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
    popover.setOutputMarkupId(true);
    add(popover);
    Form<?> form = new MidpointForm<>(ID_FORM);
    popover.add(form);
    AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {

        @Override
        protected void onError(AjaxRequestTarget target) {
            super.onError(target);
            target.add(getPageBase().getFeedbackPanel());
        }

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            super.onSubmit(target);
            pageSizeChanged(target);
        }
    };
    form.add(button);
    TextField<?> input = new TextField<>(ID_INPUT, createInputModel());
    input.add(new RangeValidator<>(5, 100));
    input.setLabel(createStringResource("PageSizePopover.title"));
    input.add(new SearchFormEnterBehavior(button));
    input.setType(Integer.class);
    form.add(input);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SearchFormEnterBehavior(com.evolveum.midpoint.web.util.SearchFormEnterBehavior) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Button(org.apache.wicket.markup.html.form.Button) TextField(org.apache.wicket.markup.html.form.TextField) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 2 with MidpointForm

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

the class TableConfigurationPanel method initPopoverLayout.

private void initPopoverLayout() {
    WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
    popover.setOutputMarkupId(true);
    add(popover);
    Form<?> form = new MidpointForm<>(ID_FORM);
    popover.add(form);
    AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(TableConfigurationPanel.this.get(createComponentPath(ID_POPOVER, ID_FORM, "inputFeedback")));
        }

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            pageSizeChanged(target);
        }
    };
    form.add(button);
    TextField<?> input = new TextField<>(ID_INPUT, createInputModel());
    input.add(new RangeValidator<>(5, 100));
    input.setLabel(createStringResource("PageSizePopover.title"));
    input.add(new SearchFormEnterBehavior(button));
    input.setType(Integer.class);
    input.setOutputMarkupId(true);
    FeedbackPanel feedback = new FeedbackPanel("inputFeedback", new ComponentFeedbackMessageFilter(input));
    feedback.setOutputMarkupId(true);
    form.add(feedback);
    form.add(input);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SearchFormEnterBehavior(com.evolveum.midpoint.web.util.SearchFormEnterBehavior) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) ComponentFeedbackMessageFilter(org.apache.wicket.feedback.ComponentFeedbackMessageFilter) FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) TextField(org.apache.wicket.markup.html.form.TextField) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 3 with MidpointForm

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

the class PageCertDecisions method initLayout.

// endregion
// region Layout
private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    CertWorkItemDtoProvider provider = createProvider();
    BoxedTablePanel<CertWorkItemDto> table = new BoxedTablePanel<CertWorkItemDto>(ID_DECISIONS_TABLE, provider, initColumns(), UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL) {

        private static final long serialVersionUID = 1L;

        @Override
        protected WebMarkupContainer createHeader(String headerId) {
            return new SearchFragment(headerId, ID_TABLE_HEADER, PageCertDecisions.this, Model.of(getCertDecisionsStorage().getShowNotDecidedOnly()));
        }
    };
    table.setShowPaging(true);
    table.setOutputMarkupId(true);
    mainForm.add(table);
// adding this on outer feedback panel prevents displaying the error messages
// addVisibleOnWarningBehavior(getMainFeedbackPanel());
// addVisibleOnWarningBehavior(getTempFeedbackPanel());
}
Also used : MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 4 with MidpointForm

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

the class PageCertDefinition method initLayout.

// endregion
// region Layout
private void initLayout() {
    CertDefinitionSummaryPanel summaryPanel = new CertDefinitionSummaryPanel(ID_SUMMARY_PANEL, new PropertyModel<>(definitionModel, CertDefinitionDto.F_DEFINITION), WebComponentUtil.getSummaryPanelSpecification(AccessCertificationDefinitionType.class, getCompiledGuiProfile()));
    summaryPanel.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(definitionModel.getObject().getOldDefinition().getOid())));
    add(summaryPanel);
    Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
    add(mainForm);
    initTabs(mainForm);
    initButtons(mainForm);
}
Also used : AccessCertificationDefinitionType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationDefinitionType) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Example 5 with MidpointForm

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

the class PageCertCampaign method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    initBasicInfoLayout(mainForm);
    initStatisticsLayout(mainForm);
    initTableLayout(mainForm);
    initButtons(mainForm);
}
Also used : MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Aggregations

MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)75 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)41 Form (org.apache.wicket.markup.html.form.Form)39 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)20 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)19 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)17 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)17 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)15 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)14 ArrayList (java.util.ArrayList)14 Label (org.apache.wicket.markup.html.basic.Label)14 IModel (org.apache.wicket.model.IModel)14 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)11 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)9 ListItem (org.apache.wicket.markup.html.list.ListItem)8 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)7 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)7 List (java.util.List)7 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)6