The execute="@all"
was just a major oversight during designing JSF2 spec. JSF kind of abstracted away too much of its HTML form based nature, forgetting that it's ultimately actually a HTML code generator.
In HTML, submitting a different form than the enclosing one is disallowed. So execute="@all"
will never work from that perspective on. It will behave exactly the same as execute="@form"
. Given that JSF is just a HTML code generator, the same "problem" will hit JSF too. It's not possible to process multiple <h:form>
components at once.
If you really need to have this feature for some reason, you should take a step back and reconsider the incorrect way how you look at HTML forms. You need to make sure your forms are designed in such way that you never need information from another form.
See also:
PrimeFaces already realized early that @all
was fundamentally wrong. That's exactly why they never supported @all
in process
attribute, their equivalent of execute
. They initially also never supported @all
in update
, their equivalent of render
. However, the only real world use case where that made sense was handling a full error page during an ajax exception, so they ultimately brought update="@all"
back after I created the FullAjaxExceptionHandler
. The process="@all"
will still have exactly the same effect as process="@form"
.
However, the very same PrimeFaces library also unintentionally made the imagined behavior of execute="@all"
possible via its later introduced partialSubmit="true"
feature whereby you explicitly specify all other forms like below (the PFS @(form)
is just for simplification, a hardcoded collection like :formId1 :formId2 :formId3
etc is also just possible).
<p:commandButton ... process="@(form)" partialSubmit="true" />
This works because partialSubmit="true"
prepares the process="xxx"
at client side rather than server side. In other words, instead of sending the entire enclosing form from server to client and then processing the specified inputs, it sends only the specified inputs from server to client and then processes them all. Do note that when partialSubmit
is absent or set to false
, then it would still only send the enclosing form. This misbehavior should rather not be relied upon. They may fix this misbehavior on their side sooner or later.
See also: