Kind of a newbie question here...
Can anyone give me an opinion on where validations should be put?
I am having a "discussion" with a co-worker about this who insists they should
all be done in a window function and that we shouldn't use the
Rows-->Column Specifications... even for simple validations.
Additionally, he wants to put a call to AcceptText() in the losefocus event,
which wrecks using validations in Row-->Column Specifications since they get
triggered all the time (even when you hit the cancel button to close the window
without saving data - so you have to fix your data before you can exit).
My personal opinion is that the losefocus event shouldn't have any code in it.
The ue_presave event should look something like this:
if ( AcceptText() = 1 ) then
if ( iou_column_state.ibassertnotnullforrequired() ) then // check non-visual
// user object to see if
PostEvent ( this, "ue_save" ) // all req'd fields are
// filled in.
and ue_save should look like this:
SetPointer ( HourGlass! )
iw_frame.SetMicroHelp ( "Updating data..." )
if ( wf_update_dw() ) then
iw_frame.SetMicroHelp ( "Data updated successfully." )
iw_frame.SetMicroHelp ( "Data not updated." )
My friend has AcceptText() calls in all the events: losefocus(), ue_presave() and
ue_save()... so when I have an error - I get three popups telling me about it,
whereas (of course - he isn't checking the return code from any of them)....
So - please tell me your strategy for handling validations!!!
Thanks very much,