TileList does not support focus in its renderers. (List, Tree, DataGrid do).  
If you look at the code in List or DataGrid you'll see how tabbing is handled.  
You can probably try to subclass TileList and add it in there, but it will be 
significant work.

Tabloops in Flex are more or less handled by a single FocusManager instance 
which is associated with "top-level" windows like the application, or popups.  
There is no support for creating new FocusManagers for containers that are 
children of another FocusManager.

The list classes can intercept KEY_FOCUS_CHANGE and override the FocusManager's 
default behavior.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
jim.abbott45
Sent: Friday, October 24, 2008 9:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: WANTED: code examples (or explanations) of 
*NON-PopUp* Tab loops


Bump. The silence is deafening.

I'm still hoping someone has some best practices or ideas to share, if not
necessarily and actual code examples.

TIA,
Jim

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, 
"jim.abbott45" <[EMAIL PROTECTED]>
wrote:
>
> Hello fellow Flexers:
>
> I'm having a hard time finding reliable information on how Tab loops
> work. I'm hoping that someone has some good code samples they could
> share that would show how to implement/use tab loops in Flex. Or,
> failing that, clearer explanations than I've been able to glean from
> the Flex documentation.
>
> FYI: I don't have any concerns with or questions about Tab loop
> (keyboard focus) support in the context of controls in a container
> that is displayed via the PopUpManager.
>
> *** The use cases that I am interested in relate to control containers
> that are NOT displayed via the PopUpManager. For example, if I create
> a control container and use it as an item renderer in, say, a
> TileList--then how does focus management get initialized and how is it
> controlled? Or even in any container that is not displayed via the
> PopUpManager?
>
>
> My specific questions are:
>
> 1) If the overall container (i.e., the TileList) instantiates or shows
> an ItemRenderer, then how do I get the keyboard focus set to a
> particular control in that new ItemRenderer/control container?
>
> FYI: I've tried adding code to the ItemRenderer's CreationComplete and
> Show events that calls the target control's setFocus() method, but
> that doesn't work. I also tried it using the FocusManager's setFocus()
> method--also doesn't work.
>
>
> 2) How do I get the keyboard focus to move from control to control (in
> my ItemRenderer/control container)?
>
> FYI: I've actually gotten this to work (more-or-less), but it took so
> much code that it seems kludgy to me and I'm wondering if there is a
> better way to do this. What I did (the kludgy? way) was to add an
> event listener for the FocusEvent.KEY_FOCUS_CHANGE to the
> ItemRenderer/control container. In the event handler, I use the id of
> the event's target to decode which control the user is tabbing _from_
> and then set nextTabItem and previousTabItem properties based on the
> currently focused control plus the target control's enablement state.
> Then I call setFocus() on either nextTabItem or previousTabItem,
> depending on the keyboard Shift state. Lastly, I call
> this.focusManger.showFocus(), because it seemed that the current focus
> highlight was not always being rendered if I didn't call the
> showFocus() method. Note: the user is tabbing between TextInput,
> Button, and RadioButton controls--I need solutions that will support
> at least all of these controls, preferably all focus-able controls.
>
> Does anyone have a best practice (or at least better) way of doing this?
>
>
> Thanks in advance for you help--flexcoders is a great resource!
> --Jim
>

Reply via email to