Gene Wirchenko
2013-01-28 20:28:56 UTC
Dear Foxers:
I have used Valid for validation in my app since the beginning. I
would now like to change it over to using LostFocus since I can not
SetFocus when there is a Valid being executed.
What is a good way of doing this?
I have come up with something that works, but it is a kludge.
I can catch the error easily enough, but there is the issue of
how to keep the focus in the control with the error.
I have a form property (.oErrorCtl) for the last error control.
.oErrorCtl is initialised to .null. in the form's .init().
For a given control, if validation succeeds, .oErrorCtl is set to
.null..
For a given control, if validation fails, .oErrorCtl is set to
this (which is the error control) and the event processing continues
(which gives focus to the next control). In the .GotFocus() of the
next control, .oErrorCtl is checked if it is not null, the focus gets
sent back with
thisform.oErrorCtl.SetFocus()
Is there a better way?
Sincerely,
Gene Wirchenko
I have used Valid for validation in my app since the beginning. I
would now like to change it over to using LostFocus since I can not
SetFocus when there is a Valid being executed.
What is a good way of doing this?
I have come up with something that works, but it is a kludge.
I can catch the error easily enough, but there is the issue of
how to keep the focus in the control with the error.
I have a form property (.oErrorCtl) for the last error control.
.oErrorCtl is initialised to .null. in the form's .init().
For a given control, if validation succeeds, .oErrorCtl is set to
.null..
For a given control, if validation fails, .oErrorCtl is set to
this (which is the error control) and the event processing continues
(which gives focus to the next control). In the .GotFocus() of the
next control, .oErrorCtl is checked if it is not null, the focus gets
sent back with
thisform.oErrorCtl.SetFocus()
Is there a better way?
Sincerely,
Gene Wirchenko