[英]JSF: How to add ajax functionality to component in backing bean?
我想將功能合並到HtmlCommandButton中。 我該怎么做? 我似乎在網上找不到太多示例。 我看到有一個叫做AjaxBehavoir的東西,但是我不確定如何將其合並到我的HtmlCommandButton中。 本質上,我想對組件執行以下操作:
<f:ajax execute="@this" render="component1 component2" />
謝謝!
您應該熟悉JSF 2.0 API中新的javax.faces.component.behavior
包的組件。
我不知道是否建議使用編程方法直接在您的后備bean中設置ajax行為,而不是更常見的習慣用法:
<h:commandButton>
<f:ajax event="onclick" execute="@this" render="component1 component2" />
</h:commandButton>
這里有幾個鏈接應該可以幫助您啟動並運行它。
<f:ajax>
組件中定義的Ajax行為與后備bean相互映射)。 希望這會有所幫助。
問候。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.