Skip to content

Commit 22d2df1

Browse files
committed
1 parent 4e879e5 commit 22d2df1

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

JqueryValidationUiGrailsPlugin.groovy

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010 the original author or authors.
1+
/* Copyright 2010-2012 the original author or authors.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
2121
*/
2222
class JqueryValidationUiGrailsPlugin {
2323
// the plugin version
24-
def version = "1.2.2"
24+
def version = "1.2.4"
2525
// the version or versions of Grails the plugin is designed for
2626
def grailsVersion = "1.2.2 > *"
2727
// the other plugins this plugin depends on
@@ -33,6 +33,11 @@ class JqueryValidationUiGrailsPlugin {
3333

3434
def author = "Lim Chee Kin"
3535
def authorEmail = "[email protected]"
36+
// Additional developers
37+
def developers = [
38+
[name:"Brian Saville", email:"[email protected]"],
39+
]
40+
3641
def title = "JQuery Validation UI Plugin - Client Side Validation without writing JavaScript"
3742
def description = '''\
3843
Grails Validation mechanism is great, I like it!
@@ -47,15 +52,19 @@ JQuery Validation plugin as it's validation engine, it had it's own solution kno
4752
The JQuery Validation UI Plugin will bring Javascript Validator, Remote Constraints, jQuery Validation plugin and [qTip (jQuery tooltip plugin)|http://craigsworks.com/projects/qtip_new/] under the same root and
4853
deliver solution more than the jQuery Validation Engine. In short, when someone ask you what is JQuery Validation UI Plugin, just show them the following code block:
4954
{code}
50-
Javascript Validator + Remote Constraints + jQuery Validation plugin + qTip
55+
Javascript Validator + Remote Constraints + Custom Constraints + jQuery Validation plugin + qTip
5156
> jQuery Validation Engine
5257
{code}
5358
54-
* Project Site and Documentation: http://code.google.com/p/jquery-validation-ui-plugin/
55-
* Support: http://code.google.com/p/jquery-validation-ui-plugin/issues/list
59+
* Source code: http://github.com/limcheekin/jquery-validation-ui
60+
* Documentation: http://limcheekin.github.com/jquery-validation-ui
61+
* Support: https://github.com/limcheekin/jquery-validation-ui/issues
62+
** Older bugs available here: http://code.google.com/p/jquery-validation-ui-plugin/issues/list
5663
* Discussion Forum: http://groups.google.com/group/jquery-validation-ui-plugin
5764
'''
5865

5966
// URL to the plugin's documentation
60-
def documentation = "http://grails.org/plugin/jquery-validation-ui"
67+
def documentation = "http://limcheekin.github.com/jquery-validation-ui"
68+
def issueManagement = [ system:"GitHub", url:"http://github.com/limcheekin/jquery-validation-ui/issues" ]
69+
def scm = [ url:"http://github.com/limcheekin/jquery-validation-ui" ]
6170
}

grails-app/controllers/org/grails/jquery/validation/ui/JQueryRemoteValidatorController.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010 the original author or authors.
1+
/* Copyright 2010-2012 the original author or authors.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@ package org.grails.jquery.validation.ui
1616

1717
import org.codehaus.groovy.grails.validation.ConstrainedPropertyBuilder
1818
import org.springframework.validation.BeanPropertyBindingResult
19-
import org.codehaus.groovy.runtime.DefaultGroovyMethods
2019

2120
/**
2221
*
@@ -47,10 +46,12 @@ class JQueryRemoteValidatorController {
4746
if (constrainedProperty.propertyType == String) {
4847
propertyValue = params[params.property]
4948
} else {
50-
propertyValue = DefaultGroovyMethods."to${constrainedProperty.propertyType.simpleName}"(params[params.property])
49+
bindData(validatableInstance, params, [include: [params.property]])
50+
propertyValue = validatableInstance."${params.property}"
5151
}
5252

5353
constrainedProperty.validate(validatableInstance, propertyValue, errors)
54+
if(validatableInstance.isAttached()) validatableInstance.discard()
5455
def fieldError = errors.getFieldError(params.property)
5556
// println "fieldError = ${fieldError}, code = ${fieldError?.code}, params.constraint = ${params.constraint}"
5657

0 commit comments

Comments
 (0)