I have two pages: login.xhtml (which has two forms, one to login in the application and another to register a new user) and user-registration.xhtml (which is called by the second form).
I am doing an ajax call as suggested here (How can we use multiple <h:messages> tags or <h:message> tags in a single JSF page?) in order to have multiple h:messages (one in each form). So I have the following:
<h:commandButton value="Register" action="#{loginController.register}">
<f:ajax execute="@form" render="@form" />
</h:commandButton>
The problem is that in the user-registration page I have a form with:
<h:commandButton value="Save" action="#{userRegistrationController.create}" />
And the method userRegistrationController.create is not being called. It happens the same as in JSF Action Method not being called
But I am using JSF 2.2 (Mojarra 2.2) and I cannot use the proposed solution as I have to put render="@form".
Any idea of how to solve this?
BalusC, I think it is not duplicate. If I delete
<f:ajax execute="@form" render="@form" />
from the login.xhtml page then the command button in user-registration.xhtml page works perfectly. But i don't want to delete it.