Grails client side validation
Asked Answered
A

2

7

How do you (if you) manage client side validation with grails ? Do you use a plugin or do you mirror your constraints using a javascript framework ? Cheers

Army answered 26/11, 2009 at 23:16 Comment(0)
A
5

I haven't used them personally but these two plugins might help you out:

http://grails.org/plugin/javascript-validator

http://www.grails.org/plugin/remote-constraints

Agist answered 26/11, 2009 at 23:44 Comment(2)
Thanks a lot ! I haven't tried the last one. Concerning the first it sounds very promising but lots of features are still missing (I think the size constraint for exemple and it is very coarse grained). Do you implement client-side validation ?Army
No, not on my current projects. I have one or two custom checks (like is the username requested during registration unique) but have not used a plugin. I think it is a good idea if it can be done in a DRY and maintainable way. If javascript-validator does some of what you need, why not contribute to it and add the things that are missing for your use cases?Agist
A
0

On Grails projects that I've been a part of, We haven't used a plugin but rather a mashup of javascript plugins and custom validators (jQuery plugins, Prototype, Dojo, etc.) to achieve the client side validation. Its handy to provide instant field-level validation on the client.

As leebutts said, The source of these plugins are open. Why not consider enhancing one(or both) of these plugins to achieve what you need and contribute that back to the community?

Might be worth checking out the new constraints plugin. With it Constraints become a Grails artefact, and might make this job easier.

Astrogate answered 27/11, 2009 at 5:48 Comment(1)
Thanks ! I trully considered contributing to the aforementioned project, I've started digging into the code, but as I am relatively new to groovy and grails I feel a bit unsecure for now. Again, thanks to both of you for your kind answers ;)Army

© 2022 - 2024 — McMap. All rights reserved.