Flex 父子窗口的数据交换
来源:互联网 发布:大庆 华为云计算 编辑:程序博客网 时间:2024/05/21 17:22
Flex 中父窗口和子窗口的数据交换的实现如下. 1 在Flex2中弹出式窗口的API如下 Package : mx.managersPopUpManager Methods : addPopUp(window:IFlexDisplayObject, parent:DisplayObject, modal:Boolean = false, childList:String = null):void 参数解释: window : 要弹出的对象,这对象必须实现了IFlexDisplayObject接口,比如TitleWindow. parent : 子窗口的父窗口对象. modal : 模式弹出(true)还是非模式弹出(false). childList : 弹出式对象在那个对象下弹出.PopUpManagerChildList.APPLICATIONPopUpManagerChildList.POPUPPopUpManagerChildList.PARENT (默认).Class :
2 实例
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
- <mx:Script>
- <![CDATA[
- importmx.events.ListEvent;
- import com.demo.PersonVO;
- importmx.events.ItemClickEvent;
- importmx.collections.ArrayCollection;
- importmx.managers.PopUpManager;
- [Bindable]
- private var testDataSource : ArrayCollection =new ArrayCollection(
- [ {id : 1 ,name :"zhangsan",language :"java"},
- {id : 2 ,name :"lisi",language :"c++"},
- {id : 3 ,name :"qianwu",language :"vb"},
- {id : 4 ,name :"xiaohong",language :"pb"},
- {id : 5 ,name :"xiaoming",language :"perl"},
- ])
- private function showDetailPersonInfo(event : ListEvent) :void
- {
- var personVO : PersonVO =new PersonVO();
- personVO.id = event.currentTarget.selectedItem.id
- personVO.name = event.currentTarget.selectedItem.name;
- personVO.language = event.currentTarget.selectedItem.language;
- //hard code the detail person information
- personVO.email = "test12638@163.com"
- personVO.married = false;
- personVO.workYears = "3 years"
- var personPopUpWindow : PersonInfomationPopWindow =new PersonInfomationPopWindow();
- personPopUpWindow.personVO = personVO;
- PopUpManager.addPopUp(personPopUpWindow,this,true);
- PopUpManager.centerPopUp(personPopUpWindow);
- }
- ]]>
- </mx:Script>
- <mx:DataGrid dataProvider="{testDataSource}" width="100%" height="100%" itemClick="showDetailPersonInfo(event)">
- <mx:columns>
- <mx:DataGridColumn dataField="id" headerText="编号" />
- <mx:DataGridColumn dataField="name" headerText="名字" />
- <mx:DataGridColumn dataField="language" headerText="开发语言" />
- </mx:columns>
- </mx:DataGrid>
- </mx:Application>
- ------------------------------
- <?xml version="1.0" encoding="utf-8"?>
- <mx:TitleWindow
- xmlns:mx="http://www.adobe.com/2006/mxml"
- width="400"
- height="300"
- showCloseButton="true"
- close="PopUpManager.removePopUp(this)">
- <mx:VBox width="400" height="200" paddingTop="10" >
- <mx:HBox width="100%" paddingLeft="10">
- <mx:Label width="40%" text="id:"/>
- <mx:Label text="{personVO.id}"/>
- </mx:HBox>
- <mx:HBox width="100%" paddingLeft="10">
- <mx:Label width="40%" text="name:"/>
- <mx:Label text="{personVO.name}"/>
- </mx:HBox>
- <mx:HBox width="100%" paddingLeft="10">
- <mx:Label width="40%" text="language:"/>
- <mx:Label text="{personVO.language}"/>
- </mx:HBox>
- <mx:HBox width="100%" paddingLeft="10">
- <mx:Label width="40%" text="workYears:"/>
- <mx:Label text="{personVO.workYears}"/>
- </mx:HBox>
- <mx:HBox width="100%" paddingLeft="10">
- <mx:Label width="40%" text="married:"/>
- <mx:Label text="{personVO.married}"/>
- </mx:HBox>
- </mx:VBox>
- <mx:Script>
- <![CDATA[
- importmx.managers.PopUpManager;
- import com.demo.PersonVO;
- [Bindable]
- public var personVO : PersonVO =null;]]>
- </mx:Script>
- </mx:TitleWindow>
- -------------------------------------------
- package com.demo
- {
- [Bindable]
- publicclass PersonVO
- {
- public var id : String ="";
- public var name : String ="";
- public var language : String ="";
- public var email : String ="";
- public var workYears : String ="";
- public var married : Boolean =false;
- }
- Flex 父子窗口的数据交换
- Flex 父子窗口的数据交换
- Flex 父子窗口通信的问题
- Flex弹出窗口实现和子父Flex窗口的数据交换
- Flex父子窗口相互调用
- Flex 使用module 父子窗口传值
- javascript父子窗口传递数据
- 父子窗口以及,子框弹框之间的数据传递。
- 子窗口和父窗口之间的数据交换问题
- QT 的父子窗口问题
- 父子窗口之间的通信
- [Flex] flex与asp.net数据交换
- javascript 之 父子窗口数据交互
- JavaScript父子窗口互传数据
- window.open父子窗口数据传递问题
- 父子窗口
- MFC拆分窗口及它们之间的数据交换
- pipe,父子进程实现读写交换数据(linux)
- linux下c编程常识
- 【PB】PB启动时系统栏总是显示我的电脑树
- repo sync: fatal: unable to connect to android.git.kernel.org
- Linux下的C编程实战之gcc\gdb\make
- cxTreeList和cxListView使用
- Flex 父子窗口的数据交换
- 树状数组专题(八)hdu2838计算逆序数
- Neighbour table overflow.
- 回车时绑定事件
- 如何用C/C++在控制台下动态输出进度
- Cisco 3750 系统升级总结
- 安装VS2010 SP1后SQL2008R2 IntelliSense失效的解决方法
- 正则验证的两种方式
- Ubuntu firefox安装flash插件