数据源student_grade.xml
<?xml version="1.0" encoding="utf-8"?>
<students>
<student name="jimmy">
<grade subject="math">100</grade>
<grade subject="history">120</grade>
</student>
<student name="lucy">
<grade subject="arts">130</grade>
<grade subject="biology">140</grade>
</student>
</students>
</countries>
flex 页面
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
<mx:XML id="dp" source="student_grade.xml" format="e4x" />
<mx:Form>
<mx:FormItem label="Student:">
<mx:ComboBox id="student" dataProvider="{dp.student}" labelField="@name" />
</mx:FormItem>
<mx:FormItem label="Grade:">
<mx:ComboBox id="grade" dataProvider="{student.selectedItem.grade}" />
</mx:FormItem>
</mx:Form>
</mx:Application>
分享到:
评论