You might be able to do this with a translator instead of a validator. They are really for converting data but you can also throw validation exceptions, access the current field and add data to the html element.
On Fri, Oct 4, 2013 at 1:51 AM, Ilya Obshadko <ilya.obsha...@gmail.com>wrote: > Hello, > > Is that possible to create a custom validator that is context-dependent? > That is, I want validation logic (including client-side JS) to depend on > actual component data. > > I have checked http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators > , > it's pretty clear how to do that, but I don't have any idea how do I inject > actual component data into validator when needed. > > Thanks in advance! > > -- > Ilya Obshadko >