【问题标题】:primefaces dialog is not workingprimefaces 对话框不起作用
【发布时间】:2017-12-07 18:53:21
【问题描述】:

这是我的对话。

<p:dialog closeOnEscape="true" resizable="false"
            header="Confirmation" widgetVar="groupconfirmation">
            <center>
                Do you want to remove this Pin Priority group?<br /> <br />
                <p:commandButton value="Yes" oncomplete="groupconfirmation.hide()"
                    actionListener="#{pinProrityHandler.deletePinPriorityGroup}"
                    update="pinprioritygroup" />

                <p:commandButton value="No"
                    actionListener="#{platformGroupHandler.onGroupReset}"
                    oncomplete="groupconfirmation.hide()" update="pinprioritygroup" />
            </center>
</p:dialog>

这是我的java代码:

  try {                 
        RequestContext.getCurrentInstance().execute("groupconfirmation.show()");
    } catch (Exception e) {
        logger.error("Error {}", e);
    }

我不知道为什么我的代码不起作用。

我是 primeface 的新手。

【问题讨论】:

标签: jsf primefaces


【解决方案1】:

对于 Primefaces

RequestContext context = RequestContext.getCurrentInstance();
context.execute("groupconfirmation.show();");

对于 Primefaces >= 4.x

RequestContext context = RequestContext.getCurrentInstance();
context.execute("PF('groupconfirmation').show();")

【讨论】:

  • 对于这些基本问题中的许多问题,stackoverflow 中已经存在重复项。其中许多具有更多的上下文细节和微尘。找到它们并标记这些问题是一种很好的做法。保持如此“干净”
猜你喜欢
  • 2013-09-10
  • 2013-02-19
  • 2014-12-24
  • 2013-08-14
  • 1970-01-01
  • 1970-01-01
  • 2013-07-02
  • 2015-02-12
  • 1970-01-01
相关资源
最近更新 更多