I want to attach custom validator to one of my input fields inside composite component, however the validator is not firing at all.
I have done it exactly as described here, but I can't get it working. Also in my code, the reference to composite component input validator (for="validateService"
) is marked red cannot resolve symbol 'validateService'
. What am I doing wrong?
component.xhtml
<cc:interface>
<cc:attribute name="service"/>
<cc:editableValueHolder name="validateService" targets="#{cc.attrs.service}"/>
</cc:interface>
page.xhtml
<cc:myComponent id="input"
service="#{myBean.service}"
<f:validator validatorId="serviceValidator" for="validateService"/>
</cc:myComponent>
I solved it by adding validator directly inside the composite pomponent input field like this
But i still have no idea why above solution doesn't work.