PL-8837 Category attribute fields that depend on the value of other fields, should be disabled until the main field is filled in

This commit is contained in:
Andrey Subbotin 2017-03-28 09:12:48 +04:00
parent 0ab4074785
commit 657ccabc92

View File

@ -389,6 +389,8 @@ public class AttributeEditor extends AbstractEditor<CategoryAttribute> {
if (attribute.getDataType() == PropertyType.ENTITY) {
if (StringUtils.isNotBlank(attribute.getEntityClass())) {
defaultEntityField.setEditable(true);
whereField.setEditable(true);
joinField.setEditable(true);
Class entityClass = attribute.getJavaClassForEntity();
MetaClass metaClass = metadata.getClass(entityClass);
defaultEntityField.setMetaClass(metaClass);
@ -398,6 +400,8 @@ public class AttributeEditor extends AbstractEditor<CategoryAttribute> {
dynamicAttributesGuiTools.initEntityPickerField(defaultEntityField, attribute);
} else {
defaultEntityField.setEditable(false);
whereField.setEditable(false);
joinField.setEditable(false);
}
if (Boolean.TRUE.equals(attribute.getLookup())) {