Apparently you haven't attached a <h:message(s)>
to the <f:viewParam id="torneo_id">
and/or you aren't updating it on every ajax request. You would otherwise have seen a required validation error on it. The concrete problem is essentially covered by point 3 of commandButton/commandLink/ajax action/listener method not invoked or input value not updated.
As to the cause, the <f:viewParam>
is executed on every single HTTP request, also on ajax postbacks. When the ajax request is sent, the desired request parameter is not present anymore in the current request and hence <f:viewParam>
fails the required validation.
There are several solutions to this:
Retain the request parameter for the subsequent request by
<f:param>
in the command component.<h:commandLink ...> ... <f:param name="id" value="#{param.id}" /> </h:commandLink>
Make it required during a non-postback only. This works only if the page is initially opened by a GET request. If it's however opened by a non-redirect navigation, then it would still fail.
<f:viewParam ... required="#{not facesContext.postback}" />
Replace
<f:viewParam>
by the one provided by JSF utility library OmniFaces, the<o:viewParam>
. It implicitly turns offrequired="true"
on postbacks so that you kan keep using the same attributes.<o:viewParam ... required="true" />