<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" title="Add Store" fontWeight="bold" fontSize="13" backgroundColor="#9AEDFF" backgroundAlpha="0.2" borderColor="#7CFFF4" themeColor="#97D7FF">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var cityList:ArrayCollection ;
[Bindable]
private var countyList:ArrayCollection ;

public function changeHandlerProvice():void{
countyList=null;
var remoteCity:RemoteObject = new RemoteObject("cityDao");
remoteCity.getCityListByPid(this.provice.selectedItem.id);
remoteCity.addEventListener(ResultEvent.RESULT,handleGetCitySuccess);
remoteCity.addEventListener(FaultEvent.FAULT,handleGetDataError);
            }
            public function changeHandlerCity():void{
var remoteCounty:RemoteObject = new RemoteObject("countyDao");
remoteCounty.getCountyListByCid(this.city.selectedItem.id);
remoteCounty.addEventListener(ResultEvent.RESULT,handleGetCountySuccess);
remoteCounty.addEventListener(FaultEvent.FAULT,handleGetDataError);
            }
            private function handleGetCitySuccess(event:ResultEvent):void{
cityList= event.result as ArrayCollection;
if(cityList!=null){
city.dataProvider = cityList;
}
}
private function handleGetCountySuccess(event:ResultEvent):void{
countyList= event.result as ArrayCollection;
if(countyList!=null){
county.dataProvider = countyList;
}
}
private function handleGetDataError(event:FaultEvent):void{
Alert.show("访问远程对象错误...","信息提示");
}

private function initCity():void{
var remoteCity:RemoteObject = new RemoteObject("cityDao");
remoteCity.getCityListByPid(1);
remoteCity.addEventListener(ResultEvent.RESULT,handleGetCitySuccess);
remoteCity.addEventListener(FaultEvent.FAULT,handleGetDataError);
var remoteCounty:RemoteObject = new RemoteObject("countyDao");
remoteCounty.getCountyListByCid(1);
remoteCounty.addEventListener(ResultEvent.RESULT,handleGetCountySuccess);
remoteCounty.addEventListener(FaultEvent.FAULT,handleGetDataError);
}

]]>
</mx:Script>
<!--<mx:XML >
<properties>
<factory>spring</factory>
<source>countyDao</source>
</properties>
</destination>
</service>

相关文章:

  • 2022-02-26
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-12-18
  • 2021-12-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-05-22
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案