Flex:将参数发送到Alert closeHandler
发布时间:2020-12-15 02:15:28 所属栏目:百科 来源:网络整理
导读:是否可以将参数发送到closeHandler Alert功能? 函数获取的fisrt参数是CloseEvent,但是如何发送另一个? s:Button id="btnLoadLocalData" label="Load data" click="Alert.show('Populate list with local data?','',Alert.YES | Alert.CANCEL,this,loadLoca
是否可以将参数发送到closeHandler Alert功能?
函数获取的fisrt参数是CloseEvent,但是如何发送另一个? <s:Button id="btnLoadLocalData" label="Load data" click="Alert.show('Populate list with local data?','',Alert.YES | Alert.CANCEL,this,loadLocalData(???parameters???),null,Alert.OK);"/> 谢谢! 解决方法
这应该可以使用Flex的动态功能构造.
here问了一个类似的问题.
这是一个例子: 参数和处理程序: var parameters:String = "Some parameter I want to pass"; private function loadLocalData(e:Event,parameter:String):void { // voila,here's your parameter } private function addArguments(method:Function,additionalArguments:Array):Function { return function(event:Event):void {method.apply(null,[event].concat(additionalArguments));} } 你的组件: <s:Button id="btnLoadLocalData" label="Load data" click="Alert.show('Populate list with local data?',addArguments(loadLocalData,[parameters])),Alert.OK);"/> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |