0
I’m wanting to call a method periodically but the listner
of poll
does not call the desired method. Below my codes:
<p:poll interval="10" update=":listaEncomendas:viewFull:resultadoPendentes,msgAtualizacao"
listener="#{encomendaController.verificarAtualizacao()}" />
The controller:
@ManagedBean
@SessionScoped
public class EncomendaController implements Serializable {
public void verificarAtualizacao() throws Exception {
final List<Encomenda> encomendas = service.findAll();
if (CollectionUtils.isNotEmpty(encomendas)) {
for (Encomenda encomenda : encomendas) {
Encomenda encomendaAux = consultarEncomenda(encomenda.getCodigo());
if (encomendaAux.getEventos().size() > encomenda.getEventos().size()) {
encomendas.remove(encomenda);
atualizarEncomenda(encomenda, encomendaAux);
encomendas.add(encomenda);
service.atualizar(encomenda);
JsfUtils.enviarEmail(encomenda);
}
}
}
pesquisar(encomendas);
}
}
One observation is that this started to occur after including listner, updating things on the screen etc was working.
The
p:poll
is amongh:form
?– Homer Simpson
@Henry is indeed.
– Roknauta