一个用ArrayCollection作为数据格式 读取远程XML绑定到DropDownList例子
2010-12-28 14:41
896 查看
这个例子没有使用 XMLListCollection 而是使用了 ArrayCollection 作为数据格式
这里用到了 HTTPService 的 result 事件进行了数据绑定处理
这里用到了 HTTPService 的 result 事件进行了数据绑定处理
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="remoteData.send()"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Script> <!--[CDATA[ import mx.collections.ArrayCollection; import mx.events.ListEvent; import mx.rpc.events.ResultEvent; import spark.events.IndexChangeEvent; [Bindable] private var m:ArrayCollection = new ArrayCollection(); protected function remoteData_resultHandler(event:ResultEvent):void { m = event.result.root.menuitem; } protected function dropdownlist1_changeHandler(event:IndexChangeEvent):void { var url:String = event.currentTarget.selectedItem.url; trace(url); if(url!=null&&url!="") { navigateToURL(new URLRequest(url),"_blank"); } } ]]--> </fx:Script> <fx:Declarations> <s:HTTPService id="remoteData" url="http://10.8.1.32/oasServices/test.xml" result="remoteData_resultHandler(event)" /> </fx:Declarations> <s:DropDownList dataProvider="{m}" labelField="name" change="dropdownlist1_changeHandler(event)"></s:DropDownList> </s:Application>
相关文章推荐
- Demo: Dictionary>> 泛型读取XML文件数据作为数据源(DataSource)绑定到DropDownList控件 定义个一个公用类
- 转载--从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 如何从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- XML文件读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 转载--从XML文件中读取数据绑定到DropDownList
- 本文介绍了如何从XML文件中读取数据绑定到DropDownList。
- 从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList-.Net编程教程
- 一个DropDownList绑定三级数据
- DataGridView (四)将一个字段绑定到多列逐行显示后取值还原数据格式
- CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- 一个Angular的双向数据绑定的例子
- WCF分布式开发常见错误(2)无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接
- 一个Hbase数据读取优化的小例子
- 分别用DataGrid、Repeater、DataList绑定XML数据的例子
- flex :读取access数据库数据 转化为xml 然后在flex页面显示绑定图片
- asp.net ajaxtoolkit CascadingDropDown从数据库中读取数据绑定到DropDownList控件上