I have a column in my entity defined as
Code:
@Column(name = "TAX_CODE")
@NotNull
@Length(max = 10)
@Pattern(regex="^\\d*$", message="You can enter only numbers into this field")
public String getTaxCode() {
return this.taxCode;
}
In my view (Seam application), I fire a custom validator
Code:
<h:inputText id="taxCode"
required="true"
size="10"
disabled="#{taxHome.managed}"
maxlength="10"
value="#{taxHome.instance.taxCode}">
<f:validator validatorId="uniqueTaxValidator" />
<a4j:support event="onblur" reRender="taxCodeDecoration" bypassUpdates="true" ajaxSingle="true"/>
</h:inputText>
The problem I am having is that the @Pattern validator is not getting fired. @NotNull and @Length work fine.
If I removed my custom validator (f:validator), @Pattern validator fires ok.
Thanks for any help.
Franco