0

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.

Community
  • 1
  • 1
Aliuk
  • 1,249
  • 2
  • 17
  • 32
  • BalusC, I think it is not duplicate. If i delete from the login.xhtml page then the command button in user-registration.xhtml page works perfectly. – Aliuk Jul 17 '16 at 16:48
  • Problem suggests a JS error. You have nowhere excluded that from being the cause based on the duplicate. – BalusC Jul 18 '16 at 12:59
  • BalusC, I didn't understand what you tried to tell me. My English is not very good. – Aliuk Jul 18 '16 at 14:23
  • Finally I fixed it putting in the login.xhtml page: ... as you suggested here: http://stackoverflow.com/questions/11408130/hcommandbutton-hcommandlink-does-not-work-on-first-click-works-only-on-second – Aliuk Jul 18 '16 at 15:10

0 Answers0