lookup picker required support

This commit is contained in:
Dmitry Abramov 2009-02-18 10:28:01 +00:00
parent edac6d2f33
commit 0afc301825
2 changed files with 7 additions and 1 deletions

View File

@ -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() {

View File

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