OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Syncmas on February 03, 2016, 12:43:42 PM

Title: OnKillFocus bug?
Post by: Syncmas on February 03, 2016, 12:43:42 PM
Attached I have created a simple modal dialog with 2 text boxes and have an OnKillFocus event on both. The problem I am running into is when I leave TextBox1 and click into TextBox2, the OnKillFocus event fires for TextBox2 and then the OnKillFocus fires for TextBox1.

I have downloaded the latest as of today to see if maybe it was a bug and was fixed but it still persists in 8.0.4.0.

Has anyone else encountered this? If so, is there some way around this? I have a calculation being done based on several text boxes and with the pre-mature firing it is creating errors in the output.

Any help is appreciated.

Thank you
Title: Re: OnKillFocus bug?
Post by: Fred Tomke on February 04, 2016, 07:43:01 AM
Hm, quite interesting: I started the project and had the same feeling as you described.
Corrected your lisp and saved the odcl anew - now it does not appear.
Please have a test with my attachment.

Regards, Fred
Title: Re: OnKillFocus bug?
Post by: owenwengerd on February 04, 2016, 10:00:36 PM
I think your example demonstrates that the events fire in the expected order. TextBox2#OnKillFocus fires in response to a message box taking focus. The message box is displayed from TextBox1#OnKillFocus. Therefore TextBox1#OnKillFocus must have been entered first. The fact that you see the message boxes in reverse order is not a consequence of the events firing incorrectly, but the fact that the message box from TextBox2#OnKillFocus is displayed before the first message box has yet been displayed. I think the sample is working as expected.
Title: Re: OnKillFocus bug?
Post by: Fred Tomke on February 05, 2016, 06:28:32 AM
Hi, I guess that you want to show an error, when the user types in a bad value.
In that case I recommend you to use an error icon beside the textbox and disabling ok-button until the value is being corrected.

Regards, Fred
Title: Re: OnKillFocus bug?
Post by: Syncmas on February 05, 2016, 06:48:52 AM
Thank you guys, your answers and examples have lead me to a solution.