Ignore:
Timestamp:
Apr 8, 2010, 6:02:16 PM (10 years ago)
Author:
duh
Message:
  • introduced template fields validation
  • added i18n messaging for validation errors
  • added template field validation support to subject fields in wizard
  • TODO: an unsetTemplateField(...) method should be added to TemplateEntity? and used in the wizard. As setting an empty value (=empty string) should result in the particular value be unset in the TemplateEntity? instance... This issue results now in not being able to unset previously set template fields.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r326 r332  
    590590                // walk through template fields
    591591                if (params.template) {
    592                         params.template.fields.each() {field ->
     592                        params.template.fields.each() { field ->
    593593                                def value = params.get(field.escapedName())
    594594
     
    722722                                if (!flow.subjects[ subjectId ].validate()) {
    723723                                        errors = true
    724                                         this.appendErrors(flow.subjects[ subjectId ], flash.errors)
     724                                        this.appendErrors(flow.subjects[ subjectId ], flash.errors, 'subject_' + subjectId + '_')
    725725                                }
    726726                        }
     
    755755        def getHumanReadableErrors(object) {
    756756                def errors = [:]
    757 
    758757                object.errors.getAllErrors().each() {
    759758                        errors[it.getArguments()[0]] = it.getDefaultMessage()
Note: See TracChangeset for help on using the changeset viewer.