JSF PRG with validation error

I am using JSF with PRG template. (use in my navigation rules).

The problem is that the redirect fails (i.e. a message followed by getting the same page) when I got validation errors (e.g .: a required value is not set by the user).

Scenario:

  • the user does not provide a required value and submits the form

  • a validation error occurs and the same view with an error message is displayed (no PRG)

  • user set a required value and sent ==> GO to next page (with PRG)

  • Problem with clicking user => button because PRG was not executed in Step 2. ==> Expired Document screen appeared in Firefox

Can anyone help me?

Thanks in advance.

Stéphane

+3


source to share


1 answer


Just submit the ajax form. It's a matter of adding

<f:ajax execute="@form" render="@form" />

      



to commands and buttons. If you are using <h:message(s)>

then I assume they are in the same form, otherwise you need to add your client IDs to render

.

Validation errors when submitting the form with ajax will not generate history.

+1


source







All Articles