major
minor
major
minor
minor
#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 the ENUM type selected. Functions for determining the value and for storing the value are specified.
Problem
If the function for determining the value returns a classifier, the display works, but in edit mode, a ClassCastException occurs during the initialization of the SelectField: "PersistentClassifier cannot be cast to Collection".
Workaround
As a workaround, the value determination must explicitly produce a single-element list with the actual value as its only element (toList()). In this case, however, the save function must also be adapted to explicitly extract the value from the passed list (firstElement()), because single-value references do not support list values.
Test
TestGridComputedEnumColumn.script.xml