Grails - combine errors in command object and subobjects -


i checked out grails: how combine domain objects' errors command objects' errors?, reason solutions aren't working me. it's possible they're grails 1.3.7 , not grails 2.2.1.

i have command object outerobjectcommand contains list of innerobjectcommand. i'm populating manually in controller, , calling validate. calling validate() on outerobjectcommand not appear validating innerobjectcommand list, validate elements of list separately. want add errors of innerobjectcommand objects , outerobjectcommand object flash.errors. how can this?

have @ last example in validator page.

vaguely, need below:

class parentcommand {     list<childcommand> childcommands     static constraints = {         childcommands validator: {val, obj ->             def errors = []             val.each{                  errors << (!it.validate() ? it.errors.allerrors : [])             }              errors?.flatten()         }     } } 

Comments

Popular posts from this blog

Why does Go error when trying to marshal this JSON? -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

python - Pygame. TypeError: 'pygame.Surface' object is not callable -