ExCode
ExCode

Reputation: 444

Vaadin Notifications with cron job

In my application, I want to display notification to the user according to the cronjob(periodically) ,In vaadin we can use Notification and the PopView for this , but seems like its not working as I expected(It does not display the notification or popup according to the cronjob,user have to click UI to display the notification) , I have another requirement. Notification should display until user click on the notification,when use click on the notification, System should popup the window with notification information, Is there any component which I can use for this in Vaadin

Thank you

Cheers

Udeshika

Upvotes: 0

Views: 1325

Answers (1)

default locale
default locale

Reputation: 13426

HTTP protocol lacks a server-side push. So, when you create a notification in a background thread Vaadin still needs a request from client browser to show a notification
So, I assume you need:

  • Background thread checking for cron job and showing notifications if necessary.
  • Client side component that will periodically poll the server for updates. You have several options:
    • ProgressIndicator has a polling functionality. Add this component to a window and use setPollingInterval method to set update interval.
    • Try to use Refresher plugin.

Updating UI from another thread - relevant discussion on vaadin.com

Upvotes: 1

Related Questions