Detail
Detail
If the dynamic visibility annotation is used to hide attributes in certain situations (visibility = hidden), this does not work for calculated attributes. For calculated attributes, the read-only visibility applies by default and this overwrites the dynamic calculated visibility for the FormField. Compare the following methods:com.top_logic.element.layout.formeditor.implementation.FieldDefinitionTemplateProvider.calculateVisibility(TLStructuredTypePart, FormVisibility, FormMode)andcom.top_logic.element.layout.formeditor.implementation.FieldDefinitionTemplateProvider.addMember(FormContext, FormContainer, TLObject, TLStructuredType, TLStructuredTypePart, String, FormVisibility, AnnotationLookup)Since calculateVisibility returns read-only for calculated attributes and not default, the visibility of the FormField, which was built and correctly initialized within addMember, is subsequently overwritten.
Test
- In tl-demo: Technical demo > Components > Dynamic visibility and there the field "Total items", which is only displayed if there are items.