0
所以我想要ajax了一個數據表來改變,並根據下拉列表中選擇的狀態進行過濾。我有以下:Ajax jsf 2基於選擇列表項選擇對數據表進行排序(在按鈕單擊上)
<p>Choose State to Filter By:</p>
<h:selectOneMenu value="#{productListingBean.choosenState}">
<f:selectItem itemValue="All" />
<f:selectItems value="#{productListingBean.stateList}" />
</h:selectOneMenu>
<h:commandButton value="Sort">
<f:ajax event="action" render="myTable" />
</h:commandButton>
和
<h:dataTable id="myTable" value="#{productListingBean.getAllProducts()}" var="product" styleClass="hovertable">
<h:column>
<f:facet name="header">
ID
</f:facet> ...
我的產品bean是請求範圍和我保存從selectOnmenu選擇在已選定的狀態變量和getAllProducts()方法處理的過濾。
我錯過了什麼,這不起作用?
都是在同一個表單內的組件? – elias 2012-07-16 15:41:36