Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List updated when a row was insert/updated in DB

I'm working with java/wicket and I need to develop a functionality that shows on real time, every new request that arrives from clients_request table into a list in the page.

I make this functionality with a script that every second clicks a button that query the bd and then reload all the table content.

There are any way to observe the bd and reload the page only when a new change on this table occurs ?

like image 242
tito Avatar asked Feb 23 '26 13:02

tito


2 Answers

If you would like the server to handle the updates (push instead of pull), you can use WebSockets, as can be seen here: http://wicketinaction.com/2012/07/wicket-6-native-websockets/

like image 77
Rob Audenaerde Avatar answered Feb 26 '26 02:02

Rob Audenaerde


Instead of programatically clicking a button change it at least to use a AjaxSelfUpdatingTimerBehavior

like image 24
Robert Niestroj Avatar answered Feb 26 '26 01:02

Robert Niestroj