Technology

I'm speaking at...

I teach and consult for

Practical, smart application development, mentoring, training.

Spring, Hibernate, Grails, Rails and Maven training from the experts!
Training Calendar

Roo in Action

Soon in print!

Spring Roo in Action
MEAP Available Now!

Author, Roo in Action - in MEAP now
Manning Book Forum
My Roo Blog Entries
Srini Penchikala InfoQ

Twittery!

@krimple
@techcast
@gdickens
@RooInAction

I host the
Chariot TechCast

« And a fun time was had by all | Main | Interview with Dan Allen on Seam, Part 1 available on the TechCast »
Tuesday
Mar172009

Interesting Plugin for Grails - javascript validation

Anyone who has programmed in Grails realizes the power of the domain-centric design pattern, including validation rules embedded as constraints in the Domain class.

Someone has written a plugin that dynamically generates Apache Commons Validator code on the fly.  It's called the javascript validator plugin and it is enabled in three steps:

Install the plugin:

grails install-plugin javascript-validator

Add to a given form with:

<jv:generateValidation domain="Employee" form="employeeForm">

Set up the form to include validation

<form id="employeeForm" onSubmit="return validateForm(this);" ... >

I'm going to give this a shot. Interesting how simple it could be to add client-side validation without re-architecting your whole code base. This is why Grails rocks!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>