【发布时间】:2011-09-04 23:22:53
【问题描述】:
基本上就是这个问题: JSF 2.0 How to display a different h:panelGroup each time an item is selected from a selectOneMenu
但我使用的是 selectOneRadio,但我没有答案说它修复的 f:ajax。 知道我可以做些什么来重新渲染我的 panelGroups 吗?
我尝试过使用 a4j:support 但没有成功。看起来它会重新渲染,但没有任何变化。也许我做错了什么。所以,我在 selectOneRadio 上放了一个 onclick="submit()" 并且它工作但它再次加载了整个页面。
<h:selectOneRadio value="#{myBean.selectedItem}" >
<a4j:support event="onclick" reRender="regionSomeItem,regionAnotherItem" />
<div class="cssClass">
<f:selectItem itemValue="someItem" itemLabel="Some Item"/>
</div>
<div class="cssClass">
<f:selectItem itemValue="anotherItem" itemLabel="Another Item"/>
</div>
<div class="clear"></div>
</h:selectOneRadio>
<a4j:region id="regionSomeItem" rendered="#{condition for some item}"/>
<a4j:region id="regionAnotherItem" rendered="#{condition for another item}"/>
【问题讨论】: