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);
}
Aggregations