I refer to one of BalusC\'s answers: JSF doesn't support cross-field validation, is there a workaround?
I follow the same way, and come out with code as below:
Mark them invalid by UIInput#setValid(), passing false
.
input1.setValid(false);
input2.setValid(false);
input3.setValid(false);
The borders are specific to PrimeFaces <p:inputText>
, so you don't need to add any CSS boilerplate as suggested by the other answerer.
Note that this can also be achieved by OmniFaces <o:validateAll> tag without the need to homegrow a custom validator.