OnKillFocus bug?

Started by Syncmas, February 03, 2016, 12:43:42 PM

Previous topic - Next topic

Syncmas

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

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

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.

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Syncmas

Thank you guys, your answers and examples have lead me to a solution.