initializeLevel

internal fun initializeLevel(levelPath: String, controls: List<Pair<ControlContext, Control<*>>>, values: Map<String, Any?>)

Creates the control states of one data level - the form, a section or a repeatable row - from the values under their names. Containers set up their own levels in setInitValue, with this same function.

Section fields come under paths ("basic_info/name"), because that is how loadData returns them, and only then does merging defaults, database values and the payload with a plain + keep all fields.

Every value has to hit a control of this level.

Parameters

levelPath

Path of the level in the schema ("" for the root, "basic_info", "publications"), for error messages.

Throws

when a value hits no control or the control does not accept it.