3
我需要傳遞一些參數(在我的例子中的id)f:ajax監聽器方法,但我不知道如何。有人幫忙嗎?如何在h中更改值的ajax請求中傳遞附加參數:selectOneMenu?
<h:form>
<!-- need to pass id value -->
<input type="hidden" name="id" id="id" value="#{id}"/>
<h:selectOneMenu value="#{visibility}">
<f:selectItems value="#{visibilities}" var="e" itemValue="#{e}" itemLabel="#{e.name}" />
<f:ajax event="valueChange" render="@form" execute="@form" listener="#{bean.updateVisibility}" />
</h:selectOneMenu>
</h:form>
豆:
class Bean {
Integer id;
public void setId() {
this.id = id;
}
public void updateVisibility(AjaxBehaviorEvent event) {
// passed id
log.debug(id);
}
}
在我的經驗,標籤內不起作用。它應該直接在UICommand組件的內部。請看這個http://stackoverflow.com/questions/11832607/fajax-doesnt-work-when-parameters-are-passed-using-fparam/11833612#11833612 –
Paras
2012-08-06 18:31:05