mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
lookup picker required support
This commit is contained in:
parent
edac6d2f33
commit
0afc301825
@ -37,7 +37,7 @@ public class AbstractField<T extends com.itmill.toolkit.ui.Field> extends Abstra
|
||||
final ItemWrapper wrapper = new ItemWrapper(datasource, metaClass.getProperties());
|
||||
component.setPropertyDataSource(wrapper.getItemProperty(metaProperty));
|
||||
|
||||
component.setRequired(metaProperty.isMandatory());
|
||||
setRequired(metaProperty.isMandatory());
|
||||
}
|
||||
|
||||
public boolean isRequired() {
|
||||
|
@ -28,4 +28,10 @@ public class LookupField
|
||||
public void setLookupDatasource(CollectionDatasource datasource) {
|
||||
component.setContainerDataSource(new CollectionDatasourceWrapper(datasource, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRequired(boolean required) {
|
||||
super.setRequired(required);
|
||||
component.setNullSelectionAllowed(!required);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user