我使用Flex工作从JVM 1.6 4个调用web服务问题与异步方法
我试图让对Java异步调用来填充3个组合框将显示国家,州和城市,这三者相关(主从关系),但有时呼叫没有被满足,或者他们没有完成,我认为这是因为他们是异步的,我怎么能确定我打电话来填充下一个组合框时,主组合框(国家)填充?
保护的函数comboCountry_changeHandler(idCombo:字符串):无效 {
selectedComboCountry= idCombo;
var countryId:String;
if(selectedComboCountry == comboCountry.id){
countryId = String(comboCountry.selectedItem.countryId);
}else if(selectedCombocountry == combocountrySuc.id){
countryId = String(comboCountrySuc.selectedItem.countryId);
}
obtainStatesResult.token = wsfacturas.obtainStates(countryId);
}
保护的函数obtainStatesResult_resultHandler(事件:的ResultEvent):无效 { VAR StateListVo:ArrayCollection的= obtainStatesResult.token.result作为ArrayCollection的;
if(selectedComboCountry == "comboCountrySuc"){
StateListsSuc.removeAll();
CityListsSuc.removeAll();
for (var d:int = 0; d < StateListVo.length; d++){
var estSuc:State = StateListVo[d];
StateListsSuc.addItem(estSuc);
}
comboStateSuc.dataProvider = StateListsSuc;
}
else if(selectedCombocountry == "combocountry"){
StateListsEmp.removeAll();
CityListsEmp.removeAll();
for (var i:int = 0; i < StateListVo.length; i++){
var estEmp:State = StateListVo[i];
StateListsEmp.addItem(estEmp);
}
comboState.dataProvider = StateListsEmp;
} else {
for (var f:int = 0; f < StateListVo.length; f++){
var est:State = StateListVo[f];
StateListsSuc.addItem(est);
StateListsEmp.addItem(est);
}
comboState.dataProvider = StateListsEmp;
comboStateSuc.dataProvider = StateListsSuc;
}
}
保护的函数comboCountry_changeHandler(idCombo:字符串):无效 \t \t \t \t {\t \t \t \t \t \t \t \t \t \t selectedComboCountry = idCombo; \t \t \t \t var countryId:String; \t \t \t \t如果(selectedComboCountry == comboCountry.id){ \t \t \t \t \t countryId =字符串(comboCountry.selectedItem.countryId); \t \t \t \t \t \t \t \t}否则,如果(selectedCombocountry == combocountrySuc。id){ \t \t \t \t \t countryId = String(comboCountrySuc.selectedItem.countryId); \t \t \t \t} \t \t \t \t \t \t \t \t \t \t \t \t \t \t obtainStatesResult.token = wsfacturas.obtainStates(countryId); \t \t \t \t \t \t \t \t \t \t \t \t} – overmann 2011-01-19 02:37:42