Primefaces Dialog framework open dialog from <p:poll>

476 Views Asked by At

Salam,

I'm trying to show a notification in a dialog dynamically from a poll component but it doesn't seem to work !!

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

the action works well when i use it with a commandButton.

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

This is my actionListener's code:

    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);
    }

I'm working with PF 6.0

Can't figure out what happens :(

1

There are 1 best solutions below

0
On

Try to add following to your p:poll oncomplete="PF('DIALOG_WIDGETVAR').show()"/> or oncomplete="PF('DIALOG_WIDGETVAR').loadContents()"/>

Maybe you also have to add update within <p:poll> so content of dialog is updated.