Re: [flexcoders] Re: FocusOut event fires over and over...
Valdhor has a good memory, but that doesn’t sound like the issue here. Other things to check: Does the Popup implement IFocusManagerContainer (it does if it is a Panel/TitleWindow) and do you have code in the popup that sets focus to a control in the PopUp on initialize or creationComplete event (if not you should)? Then fall back on using callLater so the FocusManager can finish doing its TAB thing before you create the popup. Sorry I didn’t read this thread sooner. On 3/25/10 1:41 PM, valdhor valdhorli...@embarqmail.com wrote: It may be a bug (Or a feature) in the SDK. I seem to recall Alex responding about when a pop-up closes, focus returns to the control that opened the pop-up. You may like to search the archives. One other thing to try would be adding an event listener for when the pop-up closes that prevents a new pop-up being opened until new text is placed in the text input. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Laurence lmacne...@... wrote: That doesn't seem to work either. Focus keeps returning to the original TextInput for some reason... I've even tried manually setting the focus to the next TextInput immediately after removing the FocusOut event listener on the first TextInput, before calling the pop-up window -- still doesn't work right; focus keeps going back to the first TextInput when the pop-up window closes. Now, if I click somewhere else on the screen -- in other words, I don't click or tab into the next TextInput -- the window pops up just the one time... I do not have any FocusIn or FocusOut parameters set in that second TextInput, so I don't know why clicking or tabbing into that second TextInput would cause the problem... Anything else I should try? This is just ridiculous -- it *should* work, but for some reason focus keeps getting sent back to the first TextInput. I'm running Flex Builder 3.5a, and Flash Player 10,0,42,34. Thanks, L --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , valdhor valdhorlists@ wrote: Add the focusOut event listener when you get a focusIn on the text input. Then, when your focusOut event fires and you open the pop-up window, remove the focusOut event listener from the text input. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Laurence LMacNeill@ wrote: I want a pop-up window to appear when someone tabs out of a particular TextInput in my app. So I simply set its FocusOut event equal to the function that makes the pop-up window appear... Sounds simple enough, right? But the FocusOut event keeps occurring over and over... I type something into the TextInput then hit Tab. The pop-up window pops up the way it's supposed to. I select something in the pop-up window (or close it without selecting anything) and it pops right back up. It's like my TextInput is re-gaining focus and then losing it again (which makes the window pop-up, again, forcing me to select something or close the window, which makes it happen again, etc., etc) So how do I prevent this from happening? Why is FocusOut occurring over and over and over like that? I've tried, in my FocusOut handler, setting the focus onto another TextInput before calling the pop-up window, but that does no good -- same exact results. This is incredibly frustrating! Anyone have any ideas? Thanks, Laurence MacNeill Mableton, Georgia, USA -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: FocusOut ??
No luck. In the appplication I was calling a method and not using an Alert. I am going to try the FocusManager.RichOn 9/5/06, Peter Watson [EMAIL PROTECTED] wrote: Hi Rich, When closed - a popup will return focus to whatever element had it before the popup was opened. So, even though the focus cursor is showing in the second field - the focus isn't getting completely updated in the focus manager to the second textField before the Alert popup open and gets focus. It's a timing issue - try delaying your focusOut handler with a callLater() to give the focus manager time to switch focus to the next field in the main app - then it should function the way you want. mx:TextInput id=t1 text=Hello focusOut=callLater(doSomething) / Let me know if that does the trick regards, peter From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Rich Tretola Sent: Tuesday, September 05, 2006 11:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: FocusOut ?? Anyone from Adobe ever have a chance to look into this? Rich On 8/31/06, Rich Tretola [EMAIL PROTECTED] wrote: I am having an issue where the focusOut on a text input will run the function that I have assigned but will then return focus to the calling text input. The following code shows this occuring in a simple example. Just put your focus on the top text input and then tab out. You will see the alert and you can see the cursor in the 2nd text input underneath the alert but, closing the alert then returns the focus back to the top text input. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:Script ![CDATA[ private function doSomething():void{ mx.controls.Alert.show('t1 = ' + t1.text); } ]] /mx:Script mx:TextInput id=t1 text=Hello focusOut=doSomething() / mx:TextInput id=t2 / /mx:Application Rich -- Rich Tretola mx:EverythingFlex/ http://www.EverythingFlex.com -- Rich Tretolamx:EverythingFlex/http://www.EverythingFlex.com __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Re: FocusOut ??
Hi Rich, When closed - a popup will return focus to whatever element had it before the popup was opened. So, even though the focus cursor is showing in the second field - the focus isnt getting completely updated in the focus manager to the second textField before the Alert popup open and gets focus. Its a timing issue - try delaying your focusOut handler with a callLater() to give the focus manager time to switch focus to the next field in the main app - then it should function the way you want. mx:TextInput id=t1 text=Hello focusOut=callLater(doSomething) / Let me know if that does the trick regards, peter From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rich Tretola Sent: Tuesday, September 05, 2006 11:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: FocusOut ?? Anyone from Adobe ever have a chance to look into this? Rich On 8/31/06, Rich Tretola [EMAIL PROTECTED]com wrote: I am having an issue where the focusOut on a text input will run the function that I have assigned but will then return focus to the calling text input. The following code shows this occuring in a simple example. Just put your focus on the top text input and then tab out. You will see the alert and you can see the cursor in the 2nd text input underneath the alert but, closing the alert then returns the focus back to the top text input. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:Script ![CDATA[ private function doSomething():void{ mx.controls.Alert.show('t1 = ' + t1.text); } ]] /mx:Script mx:TextInput id=t1 text=Hello focusOut=doSomething() / mx:TextInput id=t2 / /mx:Application Rich -- Rich Tretola mx:EverythingFlex/ http://www.EverythingFlex.com __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___