Copy link to clipboard
Copied
Hi,
I have a large project with some legacy code which is therefore using a mish-mash of spark and mx components.
This is fine for the most part, they work side by side with only a few niggles like remembering the difference between removeChild and removeElement etc.
BUT...
I have a complex, dynamically generated form that I should be able to tab between fields of built in mx and _EVERY_ time I tab, no matter what I do, it takes me _OUT_ of the complex generated form and plonks me in the first Spark control it finds - generally the home button at top left.
This, I hasten to add, is really not a good user experience!
I've tried all the obvious things (tab enabling, tab index etc) but Spark just seems to override it all, as if to say "why would that dirty _old_ mx component want focus? it wouldn't even know what to do with it?"
So, please, does anybody have any useful pointers on integrating mx components into the tab focus hierarchy?
Thanks,
G
hasFocusableChildren=true...
Copy link to clipboard
Copied
Hi,
Did a little test and not seeing the out of order tab behavior. I'm wondering if it might have something to do with your container hierarchy.
Here's some sample code that worked for me using AIR and the Flash Player:
<pre class="jive_text_macro jive_macro_code" jivemacro="code" ___default_attr="html"><p> | <mx:Button label="mx Btn Start" y="0" /> | ||
<s:VGroup y="30"> | |||
<s:Button label="Spark Btn 1" /> | |||
<s:Button label="Spark Btn 2" /> | |||
<mx:Canvas> | |||
<mx:TextInput y="10" text="mx TI 1" /> | |||
<mx:TextInput y="38" text="mx TI 2" /> | |||
<mx:Button label="mx Btn Submit" y="64" /> | |||
</mx:Canvas> | |||
<s:TextInput prompt="Spark TI 1"/> | |||
</s:VGroup> </p></pre> |
Good luck!
b
Copy link to clipboard
Copied
wow. that code insert is heinous!
Copy link to clipboard
Copied
Thanks Brandon,
It could well do, but the hierarchy is _also_ dynamic!
What I am seeing is not so much "out of order" (it goes correctly across and down etc) but that it simply ignores the focused VBox container and its children so that it jumps out of the focused clip to the first Spark control it finds (which happens to be at top left).
I have some MX controls within a spark control that _are_ recognised, but the dialog box I have in the centre of the screen is utterly ignored.
G
ps: Structure would be something like this:
Application
HGroup
HGroup // Spark controls that always get focus if I tab from within MX controls marked with
HGroup // Spark controls that also get focus
HGroup // Spark controls that also get focus
DividedHBox
VGroup // Spark controls that also get focus
Group
Canvas
Canvas
VBox // MX controls that don't get focus under any circumstance
pps: By "get focus" I mean "get focus when tab key is pressed" - they are focused by clicking on them
Copy link to clipboard
Copied
hasFocusableChildren=true...