Questions tagged [grails-constraints]

23 questions
0
votes
2 answers

use Java class as Grails command

I have a bunch of Java classes that I would like to use as command classes in my Grails contollers. A typical example is: class Person { String name Integer age public String getName() {return name;} public String getAge() {return…
Dónal
  • 185,044
  • 174
  • 569
  • 824
0
votes
2 answers

Grails: Property Null error

I've a domain called Modulo with some properties and a Controller with a method that create a object from model and save it, when execute save the shell show this error: La propiedad [{0}] de la clase [{1}] no puede ser nulo But if i set the…
0
votes
2 answers

Grails 3.3.2 accessing custom meta constraints

In a grails 2.4.4 project, I was able to define my own custom constraint (called 'supportsToUrl') on a domain property and use it as a tag to control rendering logic in my GSP. GSP rendering…
Ken
  • 172
  • 7
0
votes
1 answer

Grails 2.2.4: Transient Property: Why is the Custom Validator being called twice?

Given a simple domain with a transient property, such: package org.example.domain class Ninja { String name String sensei static transients = ['name'] static constraints = { name nullable:false, bindable:true, validator:…
0
votes
2 answers

Custom Grails Constraint doesn't seem to work

I have been trying to create a custom constraint in a Grails Project (see constraint code below). import org.codehaus.groovy.grails.validation.AbstractConstraint import org.springframework.validation.Errors class BuscaConstraint extends…
john
  • 1,156
  • 9
  • 22
0
votes
2 answers

How can I select multiple values from the inList constraint in Grails?

I'm new to Grails and obviously missing something out.. but what?! I created a DomainClass An with a String property category. In the constraints I defined, that this category should have multiple (list) values: class An { String category static…
mika
  • 1
  • 1
  • 3
0
votes
1 answer

Grails: How to limit the number of children in a one-to-many relationship

I want to restrict the number of children allowed in a one-to-many relationship between my Grails domain classes, preferably using constraints. The maxSize constraint seems to exist for this purpose (the Grails documentation confirms that it is…
Stephan B
  • 837
  • 1
  • 16
  • 41
0
votes
4 answers

Regex validation grails date-like format

Im currently working in a grails project and I ended up to a problem regarding matches constraints in grails. My field should only accept a String with a date-like format exactly like this: 10-25-2012 5:00PM Is this possible in matches constraint…
antibry
  • 282
  • 5
  • 22
1
2