弹出窗口无法正常显示

时间:2016-08-29 13:18:25

标签: jsf primefaces

我有一个名为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。

0 个答案:

没有答案