Re: Validate annotation on field

2016-09-16 Thread Nathan Quirynen
Hey, I tried solving it the following way using the FieldValidatorSource service: t:validate="prop:someFieldValidate" /> public FieldValidator getSomeFieldValidate() { StringBuilder validate = new StringBuilder() .append("required") .append(",")

Re: Validate annotation on field

2016-09-16 Thread Thiago H de Paula Figueiredo
On Thu, 15 Sep 2016 11:20:57 -0300, Nathan Quirynen 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 fo

Re: Validate annotation on field

2016-09-16 Thread Barry Books
I think you could do this with JSR303 validators if you detect it's a field and pass the value of the field to the validator. See: https://github.com/trsvax/tapestry-nocode/blob/master/04.md for a way to automatically validate in the onValidate event On Thursday, September 15, 2016, Nathan Quiryn

Re: Validate annotation on field

2016-09-16 Thread Nathan Quirynen
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 als