0

萨拉姆,

我正在尝试从poll组件动态地在对话框中显示通知,但它似乎不起作用!

<p:poll interval="15" listener="#{notificationBean.showNotification}" />

当我将它与commandButton.

<p:commandButton value="View" icon="ui-icon-extlink" actionListener="#{notificationBean.showNotification}" />

这是我的 actionListener 的代码:

    public void showNotification() {
        System.out.println("showNotification");
        Map<String,Object> options = new HashMap<String, Object>();
        options.put("resizable", false);
        RequestContext.getCurrentInstance()
            .openDialog("notifications/notify", options, null);
    }

我正在使用 PF 6.0

无法弄清楚会发生什么:(

4

1 回答 1

0

尝试将以下内容添加到您的 p:polloncomplete="PF('DIALOG_WIDGETVAR').show()"/>oncomplete="PF('DIALOG_WIDGETVAR').loadContents()"/>

也许您还必须在其中添加update<p:poll>以便更新对话框的内容。

于 2016-12-08T08:02:49.720 回答