0
我正在使用PF 5.2的Web應用程序。我想使用notificationBar來駐留一些數據輸入和commandButton來觸發這些輸入數據到輔助bean。因此,我在notificationBar中放置了一個commandButton,但actionListener不調用backing bean方法。 CommandButton使用「filterBtn」的id定義。Primefaces commandButton actionListener not working inside notificationBar
的.xhtml頁面代碼是在下面:
<h:form>
<p:notificationBar position="top" effect="slide" styleClass="top" widgetVar="bar" style="height:200px;">
<h:panelGrid columns="1">
<h:panelGrid id="filterGrid1" columns="4" >
<h:outputLabel id="vhclIdLbl" value="#{general.vehicleId}"/>
<p:inputText id="fMtsId" value="#{notifyBean.fMtsId}" style="width:200px"/>
<h:outputLabel id="serialNoLabel" value="#{general.serialNo}"/>
<p:inputText id="fSerialNo" value="#{notifyBean.fSerialNo}" style="width:200px"/>
<h:outputLabel id="brandLbl" value="#{general.brand}"/>
<p:selectCheckboxMenu id="fBrand" value="#{notifyBean.fBrands}" effect="slide" style="width:210px"
appendTo="@this">
<f:selectItem itemLabel="#{general.pleaseSelect}" itemValue=""/>
<f:selectItems value="#{notifyBean.brandList}"/>
</p:selectCheckboxMenu>
<h:outputLabel id="modelLabel" value="#{general.model}"/>
<p:selectCheckboxMenu id="fModel" value="#{notifyBean.fModels}" effect="slide" style="width:210px"
appendTo="@this">
<f:selectItem itemLabel="#{general.pleaseSelect}" itemValue=""/>
<f:selectItems value="#{notifyBean.modelList}"/>
</p:selectCheckboxMenu>
<h:outputLabel id="provLabel" value="#{general.province}"/>
<p:selectCheckboxMenu id="fProvince" value="#{notifyBean.fProvinces}" effect="slide" style="width:210px"
filter="true" filterMatchMode="startsWith" appendTo="@this">
<f:selectItem itemLabel="#{general.pleaseSelect}" itemValue=""/>
<f:selectItems value="#{notifyBean.provinceList}"/>
</p:selectCheckboxMenu>
<h:outputLabel id="regionLabel" value="#{general.region}"/>
<p:selectCheckboxMenu id="fRegion" value="#{notifyBean.fRegions}" effect="slide" style="width:210px"
appendTo="@this">
<f:selectItem itemLabel="#{general.pleaseSelect}" itemValue=""/>
<f:selectItems value="#{notifyBean.regionList}"/>
</p:selectCheckboxMenu>
</h:panelGrid>
<p:commandButton id="filterBtn" value="Filter" actionListener="#{notifyBean.filterByProperties()}" icon="ui-icon-arrow-1-n"/>
<p:commandButton value="Hide" onclick="PF('bar').hide()" type="button" icon="ui-icon-arrow-1-n"/>
</h:panelGrid>
</p:notificationBar>
</h:form>
我知道這是一個簡單的使用該組件,但它無法正常工作。任何幫助?