Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-dev] problem with focus lost and setFocus

Hi,

We have a requirement of validating a field when focus
is lost.
If the validation fails then focus needs to be setback
to the caller field.
The above is done through <field>.setFocus().

Also we have a number of such fields in the given
(MORE THAN ONE FIELD) editor and some of them have
focus lost validations as appropriate.

Lets say in our case 2 Text fields text1 and text2.

Problem is as follows:
1) Type something in text1 and tab out.
2) Validation fails for text1 and text1.setFocus() is
called.
3) The setFocus() method actually traverses through
all the fields in the editor and inturn calls the
focusLost listener on text2 also.
     Here the actual effect of setFocus() varies:
  i) On windows xp focus goes back to text1.
  ii)On windows2000 focus is stuck in text2.
In both the above cases all fields are traversed and
focus lost listeners called.
4) setFocus() traverses through all the fields, is
this a known bug. Are any workarounds available.
5) We have used focus lost listeners because we also
need to handle Mouse clicks. Before doing any
validation we check if the shell is active.
6) We are using Eclipse 3.0.
7) Even tried OS.setFocus() but same behaviour.

Any help/pointers are highly appreciated.

Thanks in advance.
regards,
sanjay tatikonda.



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


Back to the top