0
我有一個@ViewScoped
wordController CDI bean。它有一個方法addWord()
,它將變量currentWord
添加到List
。它沒有AJAX可以正常工作,但只要我包含f:ajax
,變量currentWord
在addWord()
方法中始終爲空。 ajax與JSF一起工作的方式有一些我不明白。這裏出了什麼問題?JSF Ajax調用時,變量設置爲空
<h:form id="saveForm" styleClass="form">
<h:inputText value="#{wordController.currentWord}" id="words" />
<h:commandButton action="#{wordController.addWord()}" type="submit" value="+">
<f:ajax render="wordlist" />
</h:commandButton>
<h:panelGroup id="wordlist">
....
我從來沒有聽說過。非常感謝! – user1156544