/** * Creates ListEditor component. * * @param valueSource value source * @param categoryAttribute category attribute * @return list editor component or null */ @Nullable public Component generateComponent(ValueSource valueSource, CategoryAttribute categoryAttribute) { ListEditor listEditor = uiComponents.create(ListEditor.NAME); listEditor.setEntityJoinClause(categoryAttribute.getJoinClause()); listEditor.setEntityWhereClause(categoryAttribute.getWhereClause()); ListEditor.ItemType itemType = getListEditorItemType(categoryAttribute.getDataType()); listEditor.setItemType(itemType); if (!Strings.isNullOrEmpty(categoryAttribute.getEntityClass())) { Class<?> clazz = scripting.loadClass(categoryAttribute.getEntityClass()); if (clazz == null) { log.error("Unable to find class of entity {} for dynamic attribute {}", categoryAttribute.getEntityClass(), categoryAttribute.getCode()); return null; } MetaClass metaClass = metadata.getClassNN(clazz); listEditor.setEntityName(metaClass.getName()); listEditor.setUseLookupField(BooleanUtils.isTrue(categoryAttribute.getLookup())); } //noinspection unchecked listEditor.setValueSource(valueSource); return listEditor; }
if (Boolean.TRUE.equals(attribute.getLookup())) { attributeFieldGroup.setVisible("screen", false); } else {
DynamicAttributesMetaProperty metaProperty = (DynamicAttributesMetaProperty) mpp.getMetaProperty(); CategoryAttribute attribute = metaProperty.getAttribute(); if (Boolean.TRUE.equals(attribute.getLookup())) { DynamicAttributesGuiTools dynamicAttributesGuiTools = AppBeans.get(DynamicAttributesGuiTools.class); CollectionDatasource optionsDatasource = dynamicAttributesGuiTools
DynamicAttributesMetaProperty metaProperty = (DynamicAttributesMetaProperty) mpp.getMetaProperty(); CategoryAttribute attribute = metaProperty.getAttribute(); if (Boolean.TRUE.equals(attribute.getLookup())) { DynamicAttributesGuiTools dynamicAttributesGuiTools = AppBeans.get(DynamicAttributesGuiTools.class); CollectionDatasource optionsDatasource = dynamicAttributesGuiTools