InitRttiPropertiesFromItemType triggers InternalGetFieldValue before init complete and raises Exception

Issue #314 resolved
Rainer Wolff created an issue

InitRttiPropertiesFromItemType checks prop.IsWriteable and sets field.ReadOnly.

This triggers redrawing of DB Controls and thus calls InternalGetFieldValue before InitRttiPropertiesFromItemType is finished.

In InternalGetFieldValue Fields are not found (because not completely initialized) and raise Exception.

Solution: Set ReadOnly Attribute after adding all the properties in a seperate step (see attached solution.pas)

Comments (3)

  1. Stefan Glienke repo owner

    The fix is actually way simpler - Disable-/EnableControls around the loop in InitRttiPropertiesFromItemType

  2. Log in to comment