1. event problem

In order to edit/check a field that has been 'tab'ed' or 'mouse'ed' away
from I must use the onLostFocus(). Then to capture certain keys for some
other needed stuff I must use onKeyDown. The problem is that this will
result in 2 events and my routines get called twice for one apparent
movement. Is there an easy way to handle this. The result is that the data
gets edited twice and 2 error messages for invalid data pop up..


...george

new topic     » topic index » view message » categorize

2. Re: event problem

George,

Within each of your 'capture' procedures, i.e. onLostFocus() and onKeyDown,
you'll have to select only those situations which you want to trigger your
routines. A few ifs might do, or maybe loop through a sequence containing
the relevant data.

Gerardo

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: event problem


>
> In order to edit/check a field that has been 'tab'ed' or 'mouse'ed' away
> from I must use the onLostFocus(). Then to capture certain keys for some
> other needed stuff I must use onKeyDown. The problem is that this will
> result in 2 events and my routines get called twice for one apparent
> movement. Is there an easy way to handle this. The result is that the data
> gets edited twice and 2 error messages for invalid data pop up..
>
>
> ...george

new topic     » goto parent     » topic index » view message » categorize

3. Re: event problem

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: event problem


>
> In order to edit/check a field that has been 'tab'ed' or 'mouse'ed' away
> from I must use the onLostFocus(). Then to capture certain keys for some
> other needed stuff I must use onKeyDown. The problem is that this will
> result in 2 events and my routines get called twice for one apparent
> movement. Is there an easy way to handle this. The result is that the data
> gets edited twice and 2 error messages for invalid data pop up..

I'm not sure why you are validating the field during the KeyDown event. It
would be better to validate the data only when focus is lost because this
event is an indication to your program that the user thinks they have
completed the data entry for that field. The KeyDown events mean that the
user has NOT finished entering data. You might want the KeyDown to stop
prevent certain characters to be entered, and if so, it would be better to
do this silently.

Also, if data in one field is being validated against data in another field,
the validation checking should only be done when the user presses the "OK"
button or its equivalent, and NOT on lost focus.

These are normal techniques for GUI apps that try to be friendly to the
user.

----
cheers
Derek.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu