h:selectOneMenu
没有在后备bean中调用侦听器方法。
<h:selectOneMenu class="form-control" id="catSoc1"
value="#{product.itemIdSelected}"
valueChangeListener="#{product.itemChangeListener1}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{product.items}" var="catprod"
itemLabel="#{catprod.name}" itemValue="#{catprod.id}" />
<p:ajax event="change" update="opl11 sco12 imgId pageImgId sco13 opl2" />
支持bean的方法是:
public void itemChangeListener1(ValueChangeEvent event) {
selectedItem = (String) event.getNewValue();
if (selectedItem != null) {
item = productUploadService.getItemOnId(selectedItem);
if (item != null) {
setTotalPages(item.getTotalpages());
}
}
}