Component Poll does not call the method

Asked

Viewed 40 times

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 among h:form ?

  • @Henry is indeed.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.