The most popular page in my JSF/PrimeFaces web app is a page with p:dataTable with data spanning date ranges (and yes, FROM and TO p:calendar are used for filtering the data along with p:inputText and p:autoComplete components, when/as necessary).
I would like to poll for changes in the data listed in the dataTable for selected dates (date range). I would like to render an Update or Refresh commandButton/Link ONLY IF data has changed for the current view for any/every user.
When a given user makes an update to data, I would like to inform other users in any/all other sessions that this data was changed, and if user(s) is/are viewing that data on a page/view via dataTable (or detailed view), then user can click Refresh button to see the update, but the Refresh button/link is only rendered via AJAX via polling. Of course, I want this 'action' to be initiated or some flag (or POJO may be more appropriate) to be stored on server ('List dataThatWasUpdated'), and polling would check this 'per' user (like the polling-Notifications implementation that I already have in place, which is working perfectly). During polling, this list will be scanned, and if user is viewing any of the data that is in the List, then Boolean will be set on another managedBean to render the commandButton/Link. This List would be set to null after each polling.
In the near or distant future, after I migrate to CDI, I will do this via CDI and server-sent-events (SSE) via HTML (and Java EE CDI, of course), but for now I am considering using or adding p:poll to give user the opportunity/option to refresh the view (since data has been updated by another user).
Please confirm my thoughts/design and/or advise. Thanks.