🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17153

Alternatives to textfield focuslost?

#17153
From: Dewi Morgan
Date: Mon, 14 Dec 1998 00:00
24 lines
1410 bytes
Problem: 
 A textfield needs it's contents verified as soon as it loses focus.

Focus listener has two possible focus lost types: temporary and permanent.

Temporary events are fine - no need to verify on them, since I do not want
to warn the user if they have just alt-tabbed away to another window for a 
moment.

So, I verify on focus lost permanent events.

However, if a focus lost temporary is thrown, then the user returns to the
view and selects another component, then no focus lost permanent is thrown.

I can see two ways of kludging around this, neither particularly pleasant:

1 - add a focus listener to all components on the view (may be dozens, and
dozens of views). This checks for unverified textfields, and returns focus
to them, or whatever.

2 - subclass all components to do this automatically when they get focus.

Is there a more pleasant way of reliably detecting that a component has
lost focus to another component on the same view?
Technical Details
Message-ID: <01be2761$7ea1da80$6671f2c1@Sasami.y-com.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,f9f20439b6068d65,start
X-Google-Attributes: gidf74b3,public
From: "Dewi Morgan" <dewi@nospam.y-com.co.uk>
Subject: Alternatives to textfield focuslost?
Date: 1998/12/14
Message-ID: <01be2761$7ea1da80$6671f2c1@Sasami.y-com.co.uk>
X-Deja-AN: 422105681
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language