Life would be better if you didn't need callLater, but sometimes you do.  I 
wouldn't make it a staple of my code base though.

When you click on something, the FocusManager tries to give it focus so if you 
try to set focus somewhere else, it may be overridden by the FocusManager.
________________________________
From: flexcoders@yahoogroups.com [flexcod...@yahoogroups.com] On Behalf Of 
Richard Rodseth [rrods...@gmail.com]
Sent: Tuesday, November 03, 2009 11:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is callLater() a hack?



I'm wondering if I'm excessively purist about not wishing to use callLater().

The specific case I have now is that I wish to set focus to the first field of 
a re-usable form when a new item is created, and select all the text in the 
field. Since I am using Mate, I have an injected listener in the view, which 
gets invoked when a new item is created. Even though the text input already has 
its text contents set by the time this listener is called, the text doesn't 
highlight unless I wrap the setFocus call in callLater(). Any ideas why that 
might happen?

Thanks.


Reply via email to