0

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 :(

Joe
  • 7,210
  • 17
  • 50
  • 92
zez
  • 53
  • 1
  • 7
  • Try with this:`` and let me know – Dibakar Paul Aug 21 '16 at 16:16
  • it doesn't work, and it's logical, because the default value of the 'autostart' attribute is "true", The problem is that in my console i get 'showNotification' and the dialog doesn't show ! – zez Aug 22 '16 at 08:45
  • Why do you need to go to the backend to show the dialog? – raven Aug 22 '16 at 21:28
  • I'm observing an Event, so when it triggers, il have to notify the user by showing a dialog – zez Aug 23 '16 at 08:04

1 Answers1

0

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.

Arthur Welsch
  • 247
  • 2
  • 12