Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Custom validator added for DataSourceLinkField is not working

$
0
0
Hi,

I have added custom regular expression validator for link field to validate URL.

It is not validating the field on call of FilterBuilder.validate().


Code snippet:
--------------
DataSourceField dataSourceSrcField = new DataSourceLinkField(name, title);
RegExpValidator expValidator = new RegExpValidator();
expValidator.setExpression("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
expValidator.setValidateOnChange(true);
dataSourceSrcField.setValidators(expValidator);

Can anyone help with this.

Regards,
Cijo P

Viewing all articles
Browse latest Browse all 4756

Trending Articles