About a year ago, while the Flex 4 ground was still moving, Andy Mcintosh blogged a well done prompting text input done with spark components and skinning. As a few people have noted in the comments to that blog, enough changed by the time Flex 4 was complete that his code no longer compiles (mainly because of the demise of the SimpleText component). I went ahead and modified his code enough to compile with Flex 4.1. I’m including the working sample in case anyone else has the same need. (view source enabled).

Tagged with:
 

TabIndex problems using PopUpManager

I recently spent some time trying to figure out why the controls on a Flex popup window didn’t seem to have any tab index. While debugging the problem I found that the focusManager was null for the popup window. I finally discovered that the PopUpManager will only automatically create a FocusManager if the popup window implements IFocusManagerContainer. It turns out that the spark VGroup component does NOT implement that interface. After switching to a BorderContainer (with a VerticalLayout) tabbing worked as expected. Here’s an example demonstrating the problem and solution (view source enabled).

Update: As JabbyPanda points out in the comments, you can take advantage of this behavior to disable the focus behavior in a popup by using a Group container. This appears to be the strategy employed by the ComboBox component.

Tagged with:
 

Categories