According to the code example in your updated question, you don't seem to delegate the validator to the correct input at all, so the validator is simply ignored at all.
You need to define the desired input (for which you want to add a validator) as <composite:editableValueHolder> in <composite:interface> .
<cc:interface> <cc:editableValueHolder name="forName" targets="inputId" /> ... </cc:interface> <cc:implementation> ... <h:inputText id="inputId" ... /> ... </cc:implementation>
The above <composite:editableValueHolder> basically says that any <f:validator for="forName"> should be applied on <h:inputText id="inputId"> <f:validator for="forName"> . So then do the following:
<cc:myComp> <f:validator id="myValidator" for="forName" /> </cc:myComp>
You can even use the same value in name and targets , but the key point is that <composite:editableValueHolder> must be present so that JSF knows which input component the validator should target. namely, to be more than one input component in the composite, you see.
Balusc
source share