0
我使用jsf2.0。我的代碼是這樣的:h:commandLink與f:ajax不起作用
<h:form id="form">
<h:commandButton value="testbutton" action="#{Bean.test}">
<f:ajax render="msg"/>
</h:commandButton>
<h:outputText value="#{Bean.outmsg}" id="msg"/>
</h:form>
它運行良好。 但如果我改變H:命令按鈕到h:commandlink, 代碼如下所示:
<h:form id="form">
<h:commandLink value="testbutton" action="#{Bean.test}">
<f:ajax render="msg"/>
</h:commandLink>
<h:outputText value="#{Bean.outmsg}" id="msg"/>
</h:form>
然後我的代碼不能工作。 我需要幫助,謝謝你們。
這是什麼意思_my代碼不能work_?同時顯示託管的bean。 – perissf
的意思是改變爲commandlink,那麼#{Bean.test}將不會被調用 – user3748888