我有与AJAX事件复选框,在改变值,该复选框会在我的豆改变一个布尔值。这个ajax事件也应该呈现一个属性为rendered="#{!*the bean's boolean*}"
的panelGrid。这意味着panelGrid在未选中时应该可见,并在选中时可见。布尔值默认设置为false(由@PostConstruct)。JSF:panelGrid中不会呈现
这是相应的代码片断:
<h:selectBooleanCheckbox id="useAddress" value="#{handleOrder.useAddress}">
<f:ajax event="change" execute="useAddress" render="outputAddress" />
</h:selectBooleanCheckbox>
<h:panelGrid id="outputAddress" rendered="#{!handleOrder.useAddress}" columns="2" width="468px">
(...)
此代码段由<h:form />
标签包围。 我getUseAddress()
和setUseAddress()
将在valuechange执行。
我的问题是,为什么我panelGrid的始终可见?
相关:http://stackoverflow.com/questions/9010734/why-do-i-need-to-nest-a-component-with-rendered-some-in-another-component- w^ – BalusC