Forget IFocusManager for now.  It just allows an abstraction for FocusManager

What you need to do depends on what you want.  Your options are:

Control:  DataGrid is a top-level control-type component.  The fact that it has 
subcomponents like a TextInput for an editor which, if outside the DG would get 
focus on its own is more-or-less abstracted from the developer.  Since the DG 
itself wants to get focus (so arrow keys and type-ahead searching work if there 
aren't any editors) means that it should implement IFocusManagerComponent, turn 
off IFocusManagerComponent.focusEnabled in its children, and handle 
keyFocusChange to deal with focus within its subcomponents.

Container:  We didn't do it this way, but a multi-thumb Slider could be a 
container-type component.  It would not implement IFocusManagerComponent as it 
never gets focus, focus goes directly to the thumbs which then use arrow keys 
to "slide around".    Such a component would set tabChildren=true and 
tabEnabled=false in its constructor.  There would be no additional work, the 
FocusManager would take care of passing focus to the sub-components assuming 
they are IFocusManagerComponents with focusEnabled=true (and tabEnabled=true 
for tabbing).

There is a separate FocusManager instance for every "tab loop".  There is one 
for the main app and one for every popup dialog whose top-level class is 
IFocusManagerContainer.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On 
Behalf Of cksachdev
Sent: Monday, February 09, 2009 11:57 AM
To: [email protected]
Subject: [flexcomponents] Re: Problem with Keyboard navigation in custom 
component


I have gone through DataGrid and List classes, both of them listen for
focusInHandler and override this method to add a listener for
"keyFocusChange" event. and then in the handler, do processing
manually for itemrenderer. My question is, do I have to do it manually
for my component which has other components which receive focus when
they are on stage. (i.e. My component is a composite of Button,
TextInput and a TextArea, do I have to manage focus manually or
FocusManager can take care of it, I read that there can be multiple
instances of FocusManager in an application, when it can be useful ?).
Could you please point me to some documentation/presentation etc.

One more question, when to use IFocusManagerComponent and when to use
IFocusManager.

(I have developed same component in Flash also. I don't have to manage
focus manually, it was taken care by FocusManager itself)

Thank you

--
Chetan
www.riageeks.com

--- In [email protected]<mailto:flexcomponents%40yahoogroups.com>, 
Alex Harui <aha...@...> wrote:
>
> In Flex components can be comprised of sub-components. The
outermost component, which is most often the thing that you think of
as the component and would normally set focus to (like a DataGrid) is
an IFocusManagerComponent with focusEnabled=true. All child sub-
components that are IFocusManagerComponents have focusEnabled=false.
When the DataGrid wants to pass focus to child cell editors, it
intercepts the keyFocusChange event and handles tabbing itself.
>
> Other components are "containers" and do not directly receive focus
and have tabChildren=true and tabEnabled=false
>
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
>
> From: [email protected]<mailto:flexcomponents%40yahoogroups.com>
[mailto:[email protected]<mailto:flexcomponents%40yahoogroups.com>]
 On Behalf Of cksachdev
> Sent: Sunday, February 08, 2009 9:14 PM
> To: [email protected]<mailto:flexcomponents%40yahoogroups.com>
> Subject: [flexcomponents] Problem with Keyboard navigation in custom
component
>
>
> Hi to all,
>
> I have developed a few set of custom components and I am facing
> problem with tab navigation. Here is a brief description about it.
>
> Problem:
> I have a class which extends UIComponent, inside it there are 2 more
> UIComponent created at runtime (inside createChildren). These are
used
> as container for subchild components. You can assume a chatbox where
> message box is inside a UIComponent and a textinput and a button is
in
> another UIComponent. Now problem is related to focus and
> tabnavigation. It gets focus on the entire component, instead of
> textinput, then on tab navigation I need to cycle it between,
> textinput and button, but when it reaches on button, it should move
to
> next UIComponent available on screen, may be a button or any other
> component available. How to know that a subcomponent is the last
> component in "MY CUSTOM COMPONENT" and now focus rectangle should
move
> to next component available in DisplayList ?
>
> Please point me to the
resources(presentations/videos/documentation).
> I have seen ACDS(Adobe Component Developer Summit) slides but not
able
> to get the point. Are those presentations being recorded ?
>
> Looking forward to a solution :)
>
> --
> chetan
> http://www.riageeks.com
>

Reply via email to