I wonder if there is a trick to validate all fields in a form except one ?
Something like :
<p:remoteCommand process="@form^F100" .... />
Obviously, this doesn't work...
If I have 100 fields in a form, is there any way or shortcut to validate all exception F100 for example ?
Am I doomed to use
<p:remoteCommand process="F1 F2 F3 F4 F5 F6 .... F99" .... />
?
You can use PrimeFaces Selectors (PFS) for this. This allows you using jQuery CSS selector syntax in process
and update
attributes of PrimeFaces ajax components. You could for example use a noprocess
class on the component which you'd like to skip and use :not(.noprocess)
selector.
Your particular requirement can then be solved as follows:
<h:form>
<h:inputText ... />
<h:inputText ... />
<h:inputText ... />
...
<h:inputText ... />
<h:inputText ... />
<h:inputText ... styleClass="noprocess" />
<p:remoteCommand ... process="@(form :not(.noprocess))"/>
</h:form>
This example will process the entire form expect of inputs having class="noprocess"
in the client side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With