Dynamically update a primefaces table

3

Hello, I'm creating a java master with Primefaces. I have the following problem: I have a screen in xhtml and the same loads the data, so far so good. The problem is when someone on another computer is accessing at the same time, you will not be able to see the new register that has been inserted, you will only be able to see if you give F5 on the page to update. Does anyone know how I can do this implementation so that this problem is solved?

    
asked by anonymous 06.11.2016 / 04:13

1 answer

2

Hello,

You can add an event that updates the table from time to time.

<p:poll interval="10" listener="#{tabelaBean.carregarTabela}"
            update="idDaTabela"/>

With this function, your table will be updated every 10 seconds.

    
07.11.2016 / 14:54