use of io.jmix.ui.component.OptionsField in project jmix by jmix-framework.
the class EntityFieldCreationSupport method createFieldComponent.
protected EntityPicker createFieldComponent(MetaClass metaClass, @Nullable Options options) {
String componentName = componentProperties.getEntityFieldType().get(metaClass.getName());
EntityPicker field;
if (options != null || EntityComboBox.NAME.equals(componentName)) {
EntityComboBox entityComboBox = uiComponents.create(EntityComboBox.class);
entityComboBox.setOptions(options != null ? options : new ContainerOptions(createCollectionContainer(metaClass)));
field = entityComboBox;
} else {
if (componentName == null || EntityPicker.NAME.equals(componentName)) {
field = uiComponents.create(EntityPicker.class);
field.setMetaClass(metaClass);
} else {
EntityPicker component = uiComponents.create(componentName);
if (component instanceof OptionsField) {
((OptionsField) component).setOptions(new ContainerOptions(createCollectionContainer(metaClass)));
}
field = component;
}
}
return field;
}
Aggregations