這是我的複選框。我正在準備監聽器中逗號分隔的組件ID字符串。這裏的問題是getter getUpdateComponentList()在調用監聽器之前被調用。所以字符串從不更新。p:ajax getter用於在收聽者之前調用更新
<p:outputPanel>
<h:selectManyCheckbox value="#{form.colors}">
<f:selectItems value="#{form.colorItems}"/>
<p:ajax listener="#{form.testListener}" event="change" update="#{form.updateComponentList}" />
</h:selectManyCheckbox>
</p:outputPanel>
@Balusc,你能不能給我一個爲例好嗎? ! – 2012-11-27 10:48:50
,因爲我找不到addPartialUpdateTargets方法 – 2012-11-27 12:55:24
@berber:它已在PrimeFaces 3.2中被棄用,並在PrimeFaces 3.4中被刪除。您需要'update()'方法。 – BalusC 2012-11-27 12:59:25