0
填充selectOneMenu用于我有一个选项[]属性年和填充方法:问题与我ApplicationBean1.java类数据
public void buildYearOptions(){
int initialYear = 1900;
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
int i = 0;
for (int y = initialYear; y< currentYear; y++){
Option op = new Option(y, Integer.toString(y));
years[i] = op;
i++;
}
}
这是使用ICEfaces的我的jsp页面:
<ice:selectOneMenu id="selectOneYearMenu" partialSubmit="true"
style="height: 24px; left: 238px; top: 94px; position: absolute; width: 72px;visibility: visible;"
visible="true">
<f:selectItems id="selectOneMenuYearItems" value="#{ApplicationBean1.years}"/>
</ice:selectOneMenu>
我的问题是1900年至今(2010年)的年份没有出现在dropDownList(selectOneMenu)中。
有人帮我解决这个问题吗?
谢谢你的答案真的有帮助。显然,在Icefaces中,你不能使用接口List,它只在我的字段是ArrayList类型时才起作用。: private ArrayList years; –
2010-06-16 08:42:26