listbox相关操作

listbox有seltext获取选中文本信息,所以可以不用回调和通知



//listbox去重复项
	for adptInfo in inet.adapter.each() {
	         if(!winForm.combobox.findEx(adptInfo.description)){  //主要是findex()
	          winForm.combobox.add(adptInfo.description)    
	         }
	    else {	    
	    }
	}
	

//默认显示项设置
winForm.combobox.add("请选择网卡")
winForm.combobox.selectString("请选择") //查找并默认选中

//循环显示网卡列表
winForm.combobox.oncommand = function(id,event){

	for adptInfo in inet.adapter.each() {
	//去重
	         if(!winForm.combobox.findEx(adptInfo.description)){
	          winForm.combobox.add(adptInfo.description)    
	         }	      	
	}	
	
		
	echo_s(winForm.combobox.selText) //selText为当前选中项的文本

}
	
//匹配选中项并操作信息
	
echo_s=function(a){
	
	for adptInfo in inet.adapter.each() {
	if(a=adptInfo.description){
		winForm.eip.text=adptInfo.ipAddressList.ipAddress ; 
	}         
	}	
}

  

posted @ 2019-03-06 21:44  遥月  阅读(244)  评论(0编辑  收藏  举报