首先是事件源,也就是从何而起,如下的一个输入框:
<mx:FormItem label="集团客户:" width="42%"> <!--change1--> <mx:TextInput id="txtAssociation" width="235" maxChars="32" change="associate();"/> </mx:FormItem>
然后就是处理效果,这些内容都是从数据库得到的数据,动态的查出的。
import mx.collections.ArrayCollection; import mx.events.FlexMouseEvent; import mx.events.ListEvent; import mx.managers.PopUpManager;
import resources.com.list.Association;
// 经过渲染的联想结果List private var list:Association; // 临时字符串,用于判断当keyUp事件发生时,联想框的值是否发生改变,如未改变则不联想 private var temp:String = ''; private function changeAssociation():void{ temp=''; txtAssociation.text=''; associationResult=null; if(list != null){ PopUpManager.removePopUp(list); list = null; // 清空临时字符串 } } private function associate():void { var str:String = txtAssociation.text; if(str.length<2){ associationResult=null; } if (str != temp) { if(str.length < 2){ if(list != null){ PopUpManager.removePopUp(list); list = null; // 清空临时字符串 temp = ''; } return; } temp = str;
var params:Object = {}; params['areaIйфAйхФ=!5ФAйхФA^_й5=UM}=]9}=UQM%=!ASg3BFFǒ:"g3>{:ф7"%
t5m
QlйIЙ 齹х1Ёф1ЁфЁф ЙIх1`SV#zp:rrZ"jV#zp:rR+j*{vjFF"Gr'krObn{:~V#zp&k*~
|