/** * Get special meta property path object for dynamic attribute by code */ @Nullable public MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, String attributeCode) { attributeCode = decodeAttributeCode(attributeCode); CategoryAttribute attribute = dynamicAttributes.getAttributeForMetaClass(metaClass, attributeCode); if (attribute != null) { return DynamicAttributesUtils.getMetaPropertyPath(metaClass, attribute); } else { return null; } }
protected void loadRequired(FieldGroup fieldGroup, FieldGroup.FieldConfig field) { CategoryAttribute attribute = dynamicAttributes.getAttributeForMetaClass(rds.resolveCategorizedEntityClass(), field.getId()); if (attribute != null) { String requiredMessage = messages.formatMainMessage( "validation.required.defaultMsg", attribute.getName() ); field.setRequired(Boolean.TRUE.equals(attribute.getRequired()) && requiredControlEnabled); field.setRequiredMessage(requiredMessage); } }
dynamicAttributes.getAttributeForMetaClass(metaClass, property) != null;
DynamicAttributes dynamicAttributesBean = AppBeans.get(DynamicAttributes.NAME); categoryAttributeValue.setCategoryAttribute( dynamicAttributesBean.getAttributeForMetaClass(getMetaClass(), attributeCode)); dynamicAttributes.put(attributeCode, categoryAttributeValue);