Lazarus

Programming => Databases => Topic started by: korba812 on April 17, 2021, 06:14:35 pm

Title: TDBEdit - why data is updated in WMKillFocus instead of EditingDone?
Post by: korba812 on April 17, 2021, 06:14:35 pm
Currently, data is updated in dataset in the WMKillFocus message handler. This can cause data update problems. The EditingDone method seems to be a more appropriate place, even the documentation mentions it:
https://lazarus-ccr.sourceforge.io/docs/lcl/controls/tcontrol.editingdone.html

But maybe there is some reason why it was implemented this way?
Title: Re: TDBEdit - why data is updated in WMKillFocus instead of EditingDone?
Post by: Thaddy on April 17, 2021, 06:42:31 pm
It is the separation between presentation (GUI) and actual compute.
The latter should always be done to keep everything OK. The former is less interesting. You can mitigate that by calling update just before you close.
What you see is not always what you get if you do not understand that difference.
TinyPortal © 2005-2018