root/trunk/grails-app/domain/dbnp/studycapturing/Study.groovy @ 101

Revision 101, 0.7 KB (checked in by duh, 4 years ago)

- refactored the wizard initial page to dynamically load pageOne, instead of rendering pageOne within the template itself. This was done because otherwise both the mainPage and pageOne had to contain duplicate logic. The ajaxified webflow works better this way.
- added an <wizard:ajaxFlowRedirect...> tag which renders javascript code executing a jQuery ajax call (it actually wraps around <wizard:button...> tag but lifts the ajax call out of the button and wraps javascript tags around it)
- improved the help / tooltip workings
- extended the <wizard:button...> with an afterSuccess argument which executes some javascript after success. This is different from the default submitToRemote 'after' behaviour which is always executed in parallel with the ajax success call (hence, you javascript cannot access ajax result data while the afterSuccess method can)

Line 
1package dbnp.studycapturing
2
3/**
4 * Domain class describing the basic entity in the study capture part: the Study class.
5 */
6class Study {
7        nimble.User owner
8        String title
9        String code
10        String researchQuestion
11        String description
12        String ecCode
13        Date dateCreated
14        Date lastUpdated
15        Date startDate
16        Template template
17
18        static hasMany = [editors: nimble.User, readers: nimble.User,
19                subjects: Subject, groups: SubjectGroup,
20                events: Event, samplingEvents: SamplingEvent]
21
22        static constraints = {
23                owner(nullable: true, blank: true)
24                title(nullable: false, blank: false)
25                template(nullable: true, blank: true)
26        }
27
28        static mapping = {
29                researchQuestion type: 'text'
30                description type: 'text'
31        }
32
33  def String toString() {
34    return title;
35  }
36
37
38}
Note: See TracBrowser for help on using the browser.