Search in sources :

Example 6 with TextFormGroup

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

the class ExpressionVariableEditorDialog method initLayout.

public void initLayout(WebMarkupContainer content) {
    Form form = new Form(ID_MAIN_FORM);
    form.setOutputMarkupId(true);
    content.add(form);
    // TODO - shouldn't this be some AutoCompleteField? If yer, where do we
    // get value?
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".name.localPart"), createStringResource("ExpressionVariableEditor.label.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(name);
    TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".description"), createStringResource("ExpressionVariableEditor.label.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(description);
    TextFormGroup path = new TextFormGroup(ID_PATH, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_PATH), createStringResource("ExpressionVariableEditor.label.path"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(path);
    DropDownFormGroup objectReference = new DropDownFormGroup<>(ID_OBJECT_REFERENCE, new PropertyModel<ObjectReferenceType>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".objectRef"), new AbstractReadOnlyModel<List<ObjectReferenceType>>() {

        @Override
        public List<ObjectReferenceType> getObject() {
            return WebModelServiceUtils.createObjectReferenceList(ObjectType.class, getPageBase(), objectMap);
        }
    }, new ObjectReferenceChoiceRenderer(objectMap), createStringResource("ExpressionVariableEditor.label.objectRef"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(objectReference);
    TextAreaFormGroup value = new TextAreaFormGroup(ID_VALUE, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VALUE), createStringResource("ExpressionVariableEditor.label.value"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(value);
    AjaxSubmitButton cancel = new AjaxSubmitButton(ID_BUTTON_CANCEL, createStringResource("ExpressionVariableEditor.button.cancel")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            cancelPerformed(target);
        }
    };
    form.add(cancel);
    AjaxSubmitButton save = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("ExpressionVariableEditor.button.apply")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            savePerformed(target);
        }
    };
    form.add(save);
}
Also used : ObjectReferenceChoiceRenderer(com.evolveum.midpoint.web.component.input.ObjectReferenceChoiceRenderer) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) TextFormGroup(com.evolveum.midpoint.web.component.form.TextFormGroup) DropDownFormGroup(com.evolveum.midpoint.web.component.form.DropDownFormGroup) Form(org.apache.wicket.markup.html.form.Form) TextAreaFormGroup(com.evolveum.midpoint.web.component.form.TextAreaFormGroup) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) ArrayList(java.util.ArrayList) List(java.util.List)

Example 7 with TextFormGroup

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

the class LimitationsEditorDialog method initLimitationBody.

private void initLimitationBody(final WebMarkupContainer body, ListItem<PropertyLimitationsTypeDto> item) {
    CheckFormGroup schema = new CheckFormGroup(ID_LAYER_SCHEMA, new PropertyModel<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_SCHEMA), createStringResource("LimitationsEditorDialog.label.schema"), ID_LABEL_SIZE, ID_INPUT_SIZE);
    schema.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(schema);
    CheckFormGroup model = new CheckFormGroup(ID_LAYER_MODEL, new PropertyModel<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_MODEL), createStringResource("LimitationsEditorDialog.label.model"), ID_LABEL_SIZE, ID_INPUT_SIZE);
    model.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(model);
    CheckFormGroup presentation = new CheckFormGroup(ID_LAYER_PRESENTATION, new PropertyModel<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_PRESENTATION), createStringResource("LimitationsEditorDialog.label.presentation"), ID_LABEL_SIZE, ID_INPUT_SIZE);
    presentation.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(presentation);
    DropDownChoicePanel add = new DropDownChoicePanel(ID_ACCESS_ADD, getAddPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
    FormComponent<PropertyAccess> addInput = add.getBaseFormComponent();
    addInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    addInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    DropDownChoicePanel read = new DropDownChoicePanel(ID_ACCESS_READ, getReadPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
    FormComponent<PropertyAccess> readInput = read.getBaseFormComponent();
    readInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    readInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    DropDownChoicePanel modify = new DropDownChoicePanel(ID_ACCESS_MODIFY, getModifyPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
    FormComponent<PropertyAccess> modifyInput = modify.getBaseFormComponent();
    modifyInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    modifyInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    body.add(add);
    body.add(read);
    body.add(modify);
    TextFormGroup minOccurs = new TextFormGroup(ID_MIN_OCCURS, new PropertyModel<String>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".minOccurs"), createStringResource("LimitationsEditorDialog.label.minOccurs"), "SchemaHandlingStep.limitations.tooltip.minOccurs", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
    minOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(minOccurs);
    TextFormGroup maxOccurs = new TextFormGroup(ID_MAX_OCCURS, new PropertyModel<String>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".maxOccurs"), createStringResource("LimitationsEditorDialog.label.maxOccurs"), "SchemaHandlingStep.limitations.tooltip.maxOccurs", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
    maxOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(maxOccurs);
    CheckFormGroup ignore = new CheckFormGroup(ID_IGNORE, new PropertyModel<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".ignore"), createStringResource("LimitationsEditorDialog.label.ignore"), "SchemaHandlingStep.limitations.tooltip.ignore", true, ID_LABEL_SIZE, ID_INPUT_SIZE);
    ignore.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
    body.add(ignore);
    Label layersTooltip = new Label(ID_T_LAYERS);
    layersTooltip.add(new InfoTooltipBehavior(true) {

        @Override
        public String getModalContainer(Component component) {
            return body.getMarkupId();
        }
    });
    body.add(layersTooltip);
    Label propertyTooltip = new Label(ID_T_PROPERTY);
    propertyTooltip.add(new InfoTooltipBehavior(true) {

        @Override
        public String getModalContainer(Component component) {
            return body.getMarkupId();
        }
    });
    body.add(propertyTooltip);
}
Also used : DropDownChoicePanel(com.evolveum.midpoint.web.component.input.DropDownChoicePanel) TextFormGroup(com.evolveum.midpoint.web.component.form.TextFormGroup) EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) Label(org.apache.wicket.markup.html.basic.Label) CheckFormGroup(com.evolveum.midpoint.web.component.form.CheckFormGroup) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) EmptyOnChangeAjaxFormUpdatingBehavior(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior) FormComponent(org.apache.wicket.markup.html.form.FormComponent) Component(org.apache.wicket.Component)

Example 8 with TextFormGroup

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

the class SynchronizationActionEditorDialog method initLayout.

private void initLayout(WebMarkupContainer content) {
    Form form = new Form(ID_MAIN_FORM);
    form.setOutputMarkupId(true);
    content.add(form);
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".name"), createStringResource("SynchronizationActionEditorDialog.label.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(name);
    TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".description"), createStringResource("SynchronizationActionEditorDialog.label.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(description);
    DropDownFormGroup<SynchronizationActionTypeDto.HandlerUriActions> handlerUri = new DropDownFormGroup<SynchronizationActionTypeDto.HandlerUriActions>(ID_HANDLER_URI, new PropertyModel<SynchronizationActionTypeDto.HandlerUriActions>(model, SynchronizationActionTypeDto.F_HANDLER_URI), WebComponentUtil.createReadonlyModelFromEnum(SynchronizationActionTypeDto.HandlerUriActions.class), new EnumChoiceRenderer<SynchronizationActionTypeDto.HandlerUriActions>(this), createStringResource("SynchronizationActionEditorDialog.label.handlerUri"), "SynchronizationStep.action.tooltip.handlerUri", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) {

        @Override
        protected DropDownChoice createDropDown(String id, IModel<List<SynchronizationActionTypeDto.HandlerUriActions>> choices, IChoiceRenderer<SynchronizationActionTypeDto.HandlerUriActions> renderer, boolean required) {
            DropDownChoice choice = new DropDownChoice<>(id, getModel(), choices, renderer);
            choice.setNullValid(true);
            return choice;
        }
    };
    form.add(handlerUri);
    DropDownFormGroup<BeforeAfterType> order = new DropDownFormGroup<BeforeAfterType>(ID_ORDER, new PropertyModel<BeforeAfterType>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".order"), WebComponentUtil.createReadonlyModelFromEnum(BeforeAfterType.class), new EnumChoiceRenderer<BeforeAfterType>(this), createStringResource("SynchronizationActionEditorDialog.label.order"), "SynchronizationStep.action.tooltip.order", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) {

        @Override
        protected DropDownChoice createDropDown(String id, IModel<List<BeforeAfterType>> choices, IChoiceRenderer<BeforeAfterType> renderer, boolean required) {
            DropDownChoice choice = new DropDownChoice<>(id, getModel(), choices, renderer);
            choice.setNullValid(true);
            return choice;
        }
    };
    form.add(order);
    initButtons(form);
}
Also used : IChoiceRenderer(org.apache.wicket.markup.html.form.IChoiceRenderer) SynchronizationActionTypeDto(com.evolveum.midpoint.web.component.wizard.resource.dto.SynchronizationActionTypeDto) TextFormGroup(com.evolveum.midpoint.web.component.form.TextFormGroup) IModel(org.apache.wicket.model.IModel) DropDownFormGroup(com.evolveum.midpoint.web.component.form.DropDownFormGroup) Form(org.apache.wicket.markup.html.form.Form) BeforeAfterType(com.evolveum.midpoint.xml.ns._public.common.common_3.BeforeAfterType) TextAreaFormGroup(com.evolveum.midpoint.web.component.form.TextAreaFormGroup) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice)

Example 9 with TextFormGroup

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

the class ReportConfigurationPanel method initLayout.

protected void initLayout() {
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ID_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(name);
    TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), ID_DESCRIPTION), createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(description);
    IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
    IChoiceRenderer renderer = new EnumChoiceRenderer();
    DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), ReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("ReportType.export"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(exportType);
    TextFormGroup virtualizerKickOn = null;
    DropDownFormGroup virtualizer = new DropDownFormGroup(ID_VIRTUALIZER, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER), createVirtualizerListModel(), new ChoiceRenderer<String>(), createStringResource("ReportType.virtualizer"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    //virtualizer.add(new VirtualizerAjaxFormUpdatingBehaviour(virtualizerKickOn));
    add(virtualizer);
    virtualizerKickOn = new TextFormGroup(ID_VIRTUALIZER_KICKON, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER_KICKON), createStringResource("ReportType.virtualizerKickOn"), ID_LABEL_SIZE, "col-md-4", false);
    add(virtualizerKickOn);
    TextFormGroup maxPages = new TextFormGroup(ID_MAXPAGES, new PropertyModel<String>(getModel(), ReportDto.F_MAXPAGES), createStringResource("ReportType.maxPages"), ID_LABEL_SIZE, "col-md-4", false);
    add(maxPages);
    TextFormGroup timeout = new TextFormGroup(ID_TIMEOUT, new PropertyModel<String>(getModel(), ReportDto.F_TIMEOUT), createStringResource("ReportType.timeout"), ID_LABEL_SIZE, "col-md-4", false);
    add(timeout);
}
Also used : IChoiceRenderer(org.apache.wicket.markup.html.form.IChoiceRenderer) TextFormGroup(com.evolveum.midpoint.web.component.form.TextFormGroup) IModel(org.apache.wicket.model.IModel) DropDownFormGroup(com.evolveum.midpoint.web.component.form.DropDownFormGroup) EnumChoiceRenderer(org.apache.wicket.markup.html.form.EnumChoiceRenderer) ExportType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExportType) PropertyModel(org.apache.wicket.model.PropertyModel) TextAreaFormGroup(com.evolveum.midpoint.web.component.form.TextAreaFormGroup)

Example 10 with TextFormGroup

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

the class UserReportConfigPanel method initLayout.

private void initLayout(final Component component) {
    TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), UserReportDto.F_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(name);
    TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), UserReportDto.F_DESCRIPTION), createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
    add(description);
    IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
    IChoiceRenderer renderer = new EnumChoiceRenderer();
    DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), UserReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("UserReportConfigPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(exportType);
    DateFormGroup dateFrom = new DateFormGroup(ID_DATE_FROM, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_FROM_GREG), createStringResource("UserReportConfigPanel.dateFrom"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(dateFrom);
    DateFormGroup dateTo = new DateFormGroup(ID_DATE_TO, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_TO_GREG), createStringResource("UserReportConfigPanel.dateTo"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    add(dateTo);
}
Also used : IChoiceRenderer(org.apache.wicket.markup.html.form.IChoiceRenderer) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) TextFormGroup(com.evolveum.midpoint.web.component.form.TextFormGroup) IModel(org.apache.wicket.model.IModel) DropDownFormGroup(com.evolveum.midpoint.web.component.form.DropDownFormGroup) EnumChoiceRenderer(org.apache.wicket.markup.html.form.EnumChoiceRenderer) ExportType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExportType) DateFormGroup(com.evolveum.midpoint.web.component.form.DateFormGroup)

Aggregations

TextFormGroup (com.evolveum.midpoint.web.component.form.TextFormGroup)10 DropDownFormGroup (com.evolveum.midpoint.web.component.form.DropDownFormGroup)6 TextAreaFormGroup (com.evolveum.midpoint.web.component.form.TextAreaFormGroup)6 IModel (org.apache.wicket.model.IModel)5 ExportType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExportType)4 Form (org.apache.wicket.markup.html.form.Form)4 List (java.util.List)3 IChoiceRenderer (org.apache.wicket.markup.html.form.IChoiceRenderer)3 DateFormGroup (com.evolveum.midpoint.web.component.form.DateFormGroup)2 MultiValueTextFormGroup (com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextFormGroup)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 EnumChoiceRenderer (org.apache.wicket.markup.html.form.EnumChoiceRenderer)2 AuditEventType (com.evolveum.midpoint.audit.api.AuditEventType)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)1 CheckFormGroup (com.evolveum.midpoint.web.component.form.CheckFormGroup)1 DropDownChoicePanel (com.evolveum.midpoint.web.component.input.DropDownChoicePanel)1 ObjectReferenceChoiceRenderer (com.evolveum.midpoint.web.component.input.ObjectReferenceChoiceRenderer)1 SynchronizationActionTypeDto (com.evolveum.midpoint.web.component.wizard.resource.dto.SynchronizationActionTypeDto)1 EmptyOnBlurAjaxFormUpdatingBehaviour (com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour)1