I have composite component in JSF 2.0
<composite:interface>
<composite:attribute name="inputId"/>
<composite:attribute name="labelValue"/>
<composite:attribute name="inputValue" />
<composite:attribute name="required" />
<composite:attribute name="requiredMessage" />
</composite:interface>
<composite:implementation>
<div class="control-group">
<h:outputLabel for="#{cc.attrs.inputId}" value="#{cc.attrs.labelValue}" class="control-label" />
<div class="controls">
<h:inputText id="#{cc.attrs.inputId}" value="#{cc.attrs.inputValue}" required="#{cc.attrs.required}" requiredMessage="#{cc.attrs.requiredMessage}" />
</div>
</div>
</composite:implementation>
and I need to make some validation on it (is it number, lenght validation etc)
So, how can I make it?
You need to define the desired input for which you’d like to attach a validator as a
<cc:editableValueHolder>in the<cc:interface>.The tag basically tells that any
<f:validator for="input">must be applied on theUIInputcomponent with the sameidas specified intargets. So, you can then register it as follows: