1、以下是javaBean中的部分内容
import java.util.List;
import java.util.ArrayList;
public class ProvinceLastWeekSaleEB {
private String tjdwdm = ""; //统计单位代码
private String tjdwmc = ""; //统计单位名称
private String xse = "0"; //销售额
private List cityList = new ArrayList(); //用来包含各地市的数据
public ProvinceLastWeekSaleEB() {
}
public ProvinceLastWeekSaleEB(String tjdwdm,String tjdwmc) {
this.tjdwdm = tjdwdm;
this.tjdwmc = tjdwmc;
}
public ProvinceLastWeekSaleEB(String tjdwdm,String tjdwmc,String xse) {
this.tjdwdm = tjdwdm;
this.tjdwmc = tjdwmc;
this.xse = xse;
}
getter.......
setter.......
public List getCityList() {
return cityList;
}
public void setCityList(String cityCode,String cityName,String cityXse) {
this.cityList.add(new CityLastWeekSaleEB(cityCode,cityName,cityXse));
}
2、mxml中的内容
public function set ProvinceValue(m:Object):void
{
provinceLastWeekSaleEB = m;
Alert.show(provinceLastWeekSaleEB[0].tjdwdm);
Alert.show(provinceLastWeekSaleEB[0].tjdwmc);
Alert.show(provinceLastWeekSaleEB[0].xse);
var citybody:ArrayCollection = ArrayCollection(provinceLastWeekSaleEB[0].cityList);
[b]Alert.show(citybody[0].cityCode);[/b]
}
请问为什么我的tjdwdm,tjdwmc,xse都能正常的取出来,而cityList却不能正常取出。
在我的java后台程序中,cityList中的信息可以在控制台输出,但是在mxml去取不出.
下面是错误提示
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at RegionBreakdown/set ProvinceValue().....