I am using OmniFaces FullAjaxExceptionHandler
and PrimeFaces. I added a command button in the errorPage.xhtml
as follows:
<h:form>
<p:commandButton id="logoutButtonId" value="Redirect" actionListener="#{userMB.logout()}">
</h:form>
The error page gets displayed properly, but the button doesn't fire the method #{userMB.logout()}
.
This is what I understand what happens in my setup:
- If an error occurs,
FullAjaxExceptionHandler
nicely displayserrorPage.xhtml
. - If I click on the button I added, the page gets updated with the same data, like as if a a refresh happens.
- If I click on the button again, then the managed bean method is triggered.
It is only in the second click that the bean method gets called. Seems that on first load, the bean method doesn't gets bound to the object.
How do I implement adding a command button in an error page with an action/actionlistener being properly bound to an HTML component when using FullAjaxExceptionHandler
?