Hi,

I'am working on form with captcha TextField based on simply
calculation (the sum of numers presented on  Label, e.g. '3 + 4')

So if the provided value is not  passed, the form will interrupt form
processing and show error information.

Currently i use that solution:

captchaField.setError(getMessage("error-key"))

I found that Field has setTextMessage method , but it is protected and
i don't have access from Page.

My questions are:
1. What is a reason that 'setErrorMessage' is protected?
2. Is the creation of CustomField only one solution for providing
Custom Validation? (Maybe there is any way for setting dynamics
validator)

Best regards,
Tomasz


P.S. I found one workaround: using of RegexField, and setting expected
result as a field's Pattern.

... Just the error message is a little weird, e.g. :  1 + 9 format must be '10'

Reply via email to