【发布时间】:2012-02-29 09:01:40
【问题描述】:
我在 flex 中使用以下示例代码时遇到了问题:
Test.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*">
<s:VGroup>
<s:TextInput id="text1"/>
<local:TestComponent id="tc1" />
<local:TestComponent id="tc2" />
<local:TestComponent id="tc3" />
<s:TextInput id="text2"/>
</s:VGroup>
</s:WindowedApplication>
TestComponent.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<fx:Declarations>
<s:RadioButtonGroup id="grp"/>
</fx:Declarations>
<s:RadioButton id="redRadio" groupName="grp"/>
<s:RadioButton id="yellowRadio" groupName="grp"/>
<s:RadioButton id="greenRadio" groupName="grp"/>
</s:Group>
当我启动应用程序并按 Tab 键循环浏览控件时,焦点跳转到第一个文本框,然后跳转到第一个 TestComponent 的第一个单选按钮,然后直接跳转到缺少第二个和第三个 TestComponents 的最后一个文本框. 这种行为对我来说似乎是错误的。谁能帮我解决这个问题?
UPD:显式设置 tabIndex 也不起作用:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*">
<s:VGroup>
<s:TextInput id="text1" tabIndex="1"/>
<local:TestComponent id="tc1" tabIndex="2"/>
<local:TestComponent id="tc2" tabIndex="3"/>
<local:TestComponent id="tc3" tabIndex="4"/>
<s:TextInput id="text2" tabIndex="5"/>
</s:VGroup>
</s:WindowedApplication>
【问题讨论】:
标签: apache-flex flex4 flex-spark