[In-App Notifications Web] Refresh Notification List not work when OnNotifyNewNotification

[In-App Notifications Web] Refresh Notification List not work when OnNotifyNewNotification

  
Forge Component
(4)
Published on 2017-09-15 by Labs
4 votes
Published on 2017-09-15 by Labs

Hi team,

Currently, I got an issue about refresh the notification list when receiving new notification. When new notification come, the number show updated (refreshed) but not the list. When click to see the list, there is no updated. However, when refresh whole page (press F5) the list get updated.

Do you guys know how to solve the issue?

Hello Khuong.

If you look at the Sample App provided with the In-App Notifications Web component, that scenario is already implemented.

But, very quickly, what is happening is:
The component handles the refresh of the number by itself, but it also provides a Notify action, which you must use to handle whatever scenarios you want to implement when there is a new notification.

Here's a quick overview of what you need to do:


Assign an action to the aforementioned Notify action:


Inside that action refresh the content of the list:

Hope this helps!


Cheers,

Rui Mendes

Rui Mendes wrote:

Hello Khuong.

If you look at the Sample App provided with the In-App Notifications Web component, that scenario is already implemented.

But, very quickly, what is happening is:
The component handles the refresh of the number by itself, but it also provides a Notify action, which you must use to handle whatever scenarios you want to implement when there is a new notification.

Here's a quick overview of what you need to do:


Assign an action to the aforementioned Notify action:


Inside that action refresh the content of the list:

Hope this helps!


Cheers,

Rui Mendes

Hello Rui Mendes,

I followed the example (do ajax refresh for both notification receiver and notification list) but only the receiver get update. The issue is that if the list is currently display, you can get updated, but when it is not display, when new notification come and we click the receiver icon to display the list, it's not updated.

I just wonder why it's not work when receiving new notification because it works (can refresh the list) when click to read or clear the list)? Any idea?

I think it's about ballon because when I'm not using balloon (just make my own similar balloon) it's work okay.


Hello Khuong.


Please try the following:

In your screen, create a new local variable and set it as an InAppNotificationOutput List

In the Preparation, use the GetNotifications action to retrieve the required notifications.

And set that previous variable with the output of the action.

In the screen, use the variable as the source for the ListRecords widget.


Now, on the OnNotify handler for the notification component, clear the variable, fetch the new notifications, set the variable with the resulting list and refresh the List widget.


Basically, use the same logic that is in the preparation, but refresh the List widget.


Hope this helps.


Cheers,

Rui Mendes