3
I’m trying to update a component on the screen by RequestContext
of primefaces
. But there are 2 situations where the first one is I click on a link and the page give your refresh. The second situation is where I have a scheduler in the system that calls a method frequently, at the end of this method I ask to update the component, here is the problem because the Requestcontext arrives as null and I am not successful, someone knows how I can solve ?
RequestContext context = RequestContext.getCurrentInstance();
context.update("listaEncomendas:viewFull:cadastroEdicaoForm:atualizacao");
You are running this method in your scheduler?
– ℛɑƒæĿᴿᴹᴿ
If your scheduler has the function of updating a jsf component you can consider using an ajax Poll that makes scheduled updates in addition to having an easy control of the beginning and end of the execution https://www.primefaces.org/showcase/ui/ajax/poll.xhtml
– ℛɑƒæĿᴿᴹᴿ
@The scheduler has a method that calls my method in question.
– Roknauta
Your Requestcontext will not be available because your scheduler is not a Managed Bean.
– ℛɑƒæĿᴿᴹᴿ
Thank you, the
poll
worked.– Roknauta