Major
Detail
Major
Detail
Detail
#27218
Grid tables: Calculated column: Single-Value SelectField requires list value.
A column is to be added to a grid table that displays a single-valued ENUM attribute of an object linked to the row object:
A "calculated column" is declared, with ENUM selected as its type. Functions for determining the value and for storing the value are specified.
Problem
If the function for value determination returns a classifier, the display works, but in edit mode there is a ClassCastException when initializing the SelectField: "PersistentClassifier cannot be cast to Collection".
Workaround
As a workaround, the value determination must explicitly produce a 1-valued list with the actual value as the only element (toList()). In this case, however, the storage function must then also be adapted to explicitly unpack the value from the passed list (firstElement()), because 1-valued references do not support list values.
Test
TestGridComputedEnumColumn.script.xml