Changeset 240 for trunk/grails-app/controllers
- Timestamp:
- Mar 5, 2010, 5:26:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r238 r240 71 71 } 72 72 73 // select the templates to use for this study74 templates {75 render(view: "_templates")76 onRender {77 flow.page = 178 }79 on("next") {80 // if we don't have a study, instantiate a study with dummy values81 if (!flow.study) {82 flow.study = new Study(83 title: "my study",84 code: "",85 ecCode: "",86 researchQuestion: "",87 description: "",88 startDate: new Date()89 )90 }91 92 // assign template to study93 flow.study.template = Template.findByName(params.get('template'));94 95 // validate study96 if (flow.study.validate()) {97 success()98 } else {99 // validation failed, feedback errors100 flash.errors = new LinkedHashMap()101 this.appendErrors(flow.study, flash.errors)102 error()103 }104 }.to "study"105 }106 107 73 // create or modify a study 108 74 start { … … 124 90 flow.page = 2 125 91 } 92 on("switchTemplate") { 93 println "switching template..." 94 println params 95 this.handleStudy(flow, flash, params) 96 }.to "study" 126 97 on("previous") { 127 98 flash.errors = new LinkedHashMap()
Note: See TracChangeset
for help on using the changeset viewer.