AdvEdit OnValueValidate

Dear Support,

We have detected an issue with the AdvEdit since the following update:
// v4.0.3.7 : Improved : Optimized triggering of OnValueValidate.

Since this modification, TCustomAdvEdit keep track of the last Validated value.
Validate save the validated value in FLastValidate and Validation won't be re-process if edited value does not change. FLastValidate is not updated when value is edited from code as validation is not called.

Howere we use GUIs where our data are updated in the OnValueValidate event.
The GUI can be re-used in different context.
For example, the advEdit can contain a value binded to a property on a object selected in a list.
In this context, the following issue occurs:
1- The list has 2 objects. Both have there property set to '1'
2- User select first object, advedit is loaded = value is set to '1' from source code (no validation called)
3- User edit '1' -> '2' in AdvEdit.
In OnValueValidate, as value is valid, we apply value to the object property.
Internally, AdvEdit set FLastValidate to '2'
4 - User select second object, advedit is loaded = value is set to '1' from source code (no validation called)
5- User edit '1' -> '2' in AdvEdit.
OnValueValidate is never called as FLastValidate is still equal to '2'
AdvEdit display '2' but object property has not been updated

Could it be possible to have a property to enable the optimization or to reset the FLastValidate when value is updated from source code (not from user edition) ? (73.6 KB)
Issue can be reproduced with this sample project:

  • Start exe
  • Select item 1 -> set value to 2 in AdvEdit -> item is well updated in listview
  • Select item 2 -> set value to 2 in AdvEdit -> 2 is not applied in the list view

It seems the behaviour depends on FocusColor.
When focusColor<>clNone, when AdvEdit get focus; TCustomAdvEdit.WMSetFocus trigger a DoValidate.
In this case, current value is Validated and set to FLastValidate... before any new user edition

We are able to reproduce this issue and will investigate as soon as possible

We traced & solved this issue. Next update will address this.