From 0afc3018254f6cf93740167d73c45789c982f17b Mon Sep 17 00:00:00 2001 From: Dmitry Abramov Date: Wed, 18 Feb 2009 10:28:01 +0000 Subject: [PATCH] lookup picker required support --- .../com/haulmont/cuba/web/gui/components/AbstractField.java | 2 +- .../com/haulmont/cuba/web/gui/components/LookupField.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/web/src/com/haulmont/cuba/web/gui/components/AbstractField.java b/modules/web/src/com/haulmont/cuba/web/gui/components/AbstractField.java index b5768fe7b1..da263b8712 100644 --- a/modules/web/src/com/haulmont/cuba/web/gui/components/AbstractField.java +++ b/modules/web/src/com/haulmont/cuba/web/gui/components/AbstractField.java @@ -37,7 +37,7 @@ public class AbstractField 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() { diff --git a/modules/web/src/com/haulmont/cuba/web/gui/components/LookupField.java b/modules/web/src/com/haulmont/cuba/web/gui/components/LookupField.java index 60cc0754d4..03dd175b2b 100644 --- a/modules/web/src/com/haulmont/cuba/web/gui/components/LookupField.java +++ b/modules/web/src/com/haulmont/cuba/web/gui/components/LookupField.java @@ -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); + } } \ No newline at end of file