我有一个名为itemnumber
<p:commandButton id="itemValidate" value="#{msgs['button.ok']}" process="itemNumber"
actionListener="#{loadCouponGroupBean.requestValidateItem}"
update="@this confirmDialog reqmessage"
oncomplete="if(#{loadCouponGroupBean.displaypopUp=='true'}){PF('confirmDialog').show()}">
<f:attribute name="itemNumber"
value="#{loadCouponGroupBean.itemBo.id}" />
</p:commandButton>
<p:message id="reqmessage" for="item" />
在我的支持bean中
if (itemNumber != null) {
// TODO need to call the webservice for which the details are not
// known
try {
generalFunctionCouponGrpItems = campaignManagementDelegate.validateItem(itemNumber);
couponGroupManageBean.setValidatedItemNo(itemNumber);
displaypopUp = true;
} catch (NoDataFoundException e) {
displaypopUp=false;
}
} else {
MessageUtil.showFieldMsg("msg.mustBeFilled", Constants.MSG_PACKAGE, FacesMessage.SEVERITY_ERROR, false, "item");
}
PrimeFaces弹出窗口的代码是
<p:confirmDialog widgetVar="confirmDialog" global="true"
showEffect="fade" id="confirmDialog" hideEffect="fade"
message="#{msgs['msg.changeTemplate']}"
header="#{msgs['msg.confirmation']}">
<p:commandButton value="Yes" type="button"
styleClass="ui-confirmdialog-yes" icon="ui-icon-check"
onclick="PF('confirmDialog').hide()" />
<p:commandButton value="No" type="button"
styleClass="ui-confirmdialog-no" icon="ui-icon-close"
onclick="PF('template').selectValue(PF('template').preShowValue.val());PF('confirmDialog').hide()" />
</p:confirmDialog>
现在,当用户输入项目编号并按下OK按钮时,如果文章被链接,我需要显示一个弹出窗口,但不会显示不正确。
Ex:itemnumber:107259,这是应显示弹出窗口的有效itemnumber。 输入107259后,如果我再次输入1234这是无效的项目编号,则会显示popip。