【发布时间】:2013-12-06 13:07:55
【问题描述】:
我正在尝试在 JSF 中实现级联下拉。列出我在下面做的事情请帮助我
XHTML 代码:
<h:selectOneMenu value="#{bean.country_id}" id="countries">
<f:selectItem itemLabel="-- Select a Country -- " itemValue="0"/>
<f:selectItems value="#{bean.countries}" var="country" id="countryList"/>
<f:ajax event="change" listener="#{bean.getCityList}" execute="countries" render="cityList" />
</h:selectOneMenu>
<h:selectOneMenu value="#{bean.city_id}" id="cities">
<f:selectItem itemLabel="-- Select a City -- " itemValue="0"/>
<f:selectItems value="#{bean.cities}" var="city" id="cityList" />
</h:selectOneMenu>
一旦我们更改国家/地区,调用将转到 getCityList,并且我们也在该方法中获取国家/地区值,但 getcitylist 中返回的列表未应用于 cityList,xhtml 抛出错误。
请在这方面帮助我
谢谢 KK
【问题讨论】: