我有與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