Just started playing with the plugin and it looks pretty neat. I
spotted a slight problem, though. In message.properties, you can
specify a human-friendly label for properties. For example, in my
little test app I have:
thing.height.label=Height
This shows fine in the error messages returned from the server, but it
doesn't seem to work for the JavaScript on the client. In my
constraints for Thing, I have 'height min:20,max:40, nullable:false'.
This is what we get in the JavaScript - note the lowercase form of the
property, not using the label:
messages: {
height: {
digits: 'Property height must be a valid number',
min: function() { return ''height' with value ' + $('#height').val()
+ ' is less than minimum value 20'; },
max: function() { return ''height' with value ' + $('#height').val()
+ ' exceeds maximum value 40'; },
required: ''height' cannot be empty'
},
Also, I get this JavaScript error, which I presume is related:
Error: missing ; before statement
Source File:
http://localhost:8080/MiniDemo/thing
Line: 56, Column: 26
Source Code:
min: function() { return ''height' with value ' + $('#height').val()
+ ' is less than minimum value 20'; },