I am getting this warning org.primefaces.PrimeFaces$Ajax.update PrimeFaces.current().ajax().update() called but component can't be resolved!Expression will just be added to the renderIds.
Sometimes when using PrimeFaces.current().ajax().update
I get the above warning, searching I implemented this solution https://forum.primefaces.org/viewtopic.php?t=58678
public static UIComponent findComponentById(String componentId) {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
return root.findComponent(componentId);
}
So to avoid getting the warning I do the following:
if (FacesUtils.findComponentById("pnlEstado") != null) {
PrimeFaces.current().ajax().update("pnlEstado");
}
And it works, it does no longer throw the warning because component is always "findable" for updating.
The problem here is that my partner said he isn't sure if this is the best way to handle the warning because he thinks it will take alot of time when this is in production for it to execute, he said like this goes to client then comebacks to server then again to client, how this works he asked, and I didn't really know how to explain but the thing is I think this is the best way to handle it, want to know your opinion about it.
I also tried with binding component and checking if it is rendered but it is always true that it is rendered so it always updates and throws warning.
So I removed bindings and used this way. Also this only happens because I have 2 menus, when 1 is open the other one is not displayed, so I think thats why the update throws warning sometimes, but the solution I implemented solves it, anyways im open to your opinions.
Also this is the way he said he prefers me to solve it, im gonna try it https://forum.primefaces.org/viewtopic.php?t=32040
But I think its better with the one I want to use