Hey thanks for your reply.

The problem is that the regular expression is defined in a library as a constant and reused at a lot of places, so I want to use this constant instead of putting it everywhere myself, that's why I'm searching for another solution where I can use this constant and also without using the @Validate annotation as I have no access to the field declarations (also in a library).


On 16/09/16 14:14, Thiago H de Paula Figueiredo wrote:
On Thu, 15 Sep 2016 11:20:57 -0300, Nathan Quirynen <nat...@pensionarchitects.be> wrote:

Hi,

Hi!

@Validate("regexp="+SOME_REGEXP)
@InjectComponent
private Field someField;
But this does not seem to work?

This isn't supposed to work. You should annotate the field or getter whose value is being validated, not the form field component. What about adding validate="regexp:[\\d]{1-2}", for example, to the <t:textfield> directly?

Is there any other way to add validators to a field programatically when you have no access to the property declarations? I could do all validation myself in the onValidate event, but this does not seem optimal.

See above.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to