I was looking at the validator js on github https://github.com/apache/tapestry-5/blob/bb255c0a144a19939d357c0f071570eea272c918/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
but found myself lost in the coffee script. Now if I understand you correctly, when the fields are rendered, data- attributes are added to the fields and then used by my validation js? Thanks Guys, On Thu, Nov 21, 2013 at 1:53 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 21 Nov 2013 15:55:33 -0200, George Christman < > gchrist...@cardaddy.com> wrote: > > Hello, I'm trying to build a custom validator but noticed some changes >> regarding the js in 5.4. >> > > Does anybody know of a simple approach to handling the js piece of the >> code? >> >> javaScriptSupport.require("t5/core/validation"); >> writer.attributes(DataConstants.VALIDATION_ATTRIBUTE, true, >> "data-validate-maxscale", constraintValue.toString(), >> "data-maxscale-message", buildMessage(formatter, >> field, constraintValue)); >> > > I'm sorry, I'm not sure I know what you're asking. Anyway, just think that > the data you need to perform the validation client-side now follows the way > better approach of being located in data-* attributes instead of variables. > Now just make your validation JavaScript code search for elements with the > data-* attributes you're adding and add the validation hooks to them. Have > you checked how the Tapestry validators are written? That's what I'd do > until the documentation about it isn't available. > > > > I'm not sure if I should be using coffee or what I'm suppose to be doing. >> > > You don't need to use CoffeeScript yourself. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York