Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refresh datatable in one page when data change in another page using primeFaces

I need to refresh dataTable in index1.xhtml (index1.xhtml and index2.xhtml are open by clients) when I change data in index2.xhtml and click a command button.
I don't want to use polling.

like image 505
Mahdi Avatar asked Dec 07 '25 01:12

Mahdi


1 Answers

If you don't want to use polling you can use primefaces push. I can't see any other options, you must be notified by the server that data were changed. Primefaces push will be better because lighter, anyway be careful it's not yet available in all browsers (see: http://caniuse.com/#feat=websockets). You'll need to build a mechanism to publish a message to all clients connected to index2.xhtml when something was changed in index1.xhtml using JMS for instance. Also you should know that websockets won't go through AJP.

like image 153
Alexandre Jacob Avatar answered Dec 08 '25 13:12

Alexandre Jacob