Enhancement
Critical
Major
Detail
Detail
Major
#26093
Implementations of calculated attributes cannot be overwritten
Given its two concrete types A and B, both derive from the interface V. V declares a reference-valued attribute x without further implementation.
x is overridden at A and B respectively, with different storage rules for calculating the values. e.g.
- A.x always returns A (self-reference)
- B.x always returns ROOT (or another context element).
When querying values, the framework does not always correctly find the correct configuration:
// $x.instanceOf(`A`) == true $x.get(`A.x`) returns A $x.get(`V.x`) returns null $x.get(`B.x`) returns null or exception
// $x.instanceOf(`B`) == true $x.get(`A.x`) return null or Exception $x.get(`V.x`) return null $x.get(`B.x`) return ROOT
A side effect of this is that if no form definition is stored at the type and the framework falls back on "other attributes", then the form field for x always returns null. If, on the other hand, a form definition is specified at the concrete type, then the form field for x contains the expected value. This is probably due to the fact that in the background the framework requests the interface attribute without a form definition, otherwise the concrete attribute.
Test
- View in tl-demo: Technical Demo:Tests:Override
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/model/attributes/override/TestValuesOfOverriddenAttributesInForms.script.xml