Search in sources :

Example 6 with ObjectReferenceChoiceRenderer

use of com.evolveum.midpoint.web.component.input.ObjectReferenceChoiceRenderer 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)

Aggregations

ObjectReferenceChoiceRenderer (com.evolveum.midpoint.web.component.input.ObjectReferenceChoiceRenderer)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)5 ArrayList (java.util.ArrayList)5 List (java.util.List)5 Label (org.apache.wicket.markup.html.basic.Label)5 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)4 MultiValueTextEditPanel (com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextEditPanel)3 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)3 Form (org.apache.wicket.markup.html.form.Form)3 ListItem (org.apache.wicket.markup.html.list.ListItem)3 IModel (org.apache.wicket.model.IModel)3 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)2 MultiValueDropDownPanel (com.evolveum.midpoint.web.component.form.multivalue.MultiValueDropDownPanel)2 StringChoiceRenderer (com.evolveum.midpoint.web.component.input.StringChoiceRenderer)2 TriStateComboPanel (com.evolveum.midpoint.web.component.input.TriStateComboPanel)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)2 AjaxSubmitLink (org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink)2 TextField (org.apache.wicket.markup.html.form.TextField)2