source: trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy @ 86

Last change on this file since 86 was 86, checked in by duh, 9 years ago
File size: 1.9 KB
Line 
1package dbnp.studycapturing
2import dbnp.studycapturing.*
3import grails.converters.*
4
5/**
6 * Wizard Controler
7 *
8 * The wizard controller handles the handeling of pages and data flow
9 * through the study capturing wizard.
10 *
11 * @author  Jeroen Wesbeek
12 * @since   20100107
13 * @package studycapturing
14 *
15 * Revision information:
16 * $Rev$
17 * $Author$
18 * $Date$
19 */
20class WizardController {
21    /**
22     * index method, redirect to the webflow
23     * @void
24     */
25    def index = {
26      /**
27       * Do you believe it in your head?
28       * I can go with the flow
29       * Don't say it doesn't matter (with the flow) matter anymore
30       * I can go with the flow (I can go)
31       * Do you believe it in your head?
32       */
33      redirect(action:'pages')
34    }
35
36    /**
37     * WebFlow definition
38     * @see http://grails.org/WebFlow
39     * @void
40     */
41    def pagesFlow = {
42      // start the flow
43      onStart {
44        println "wizard started"
45      }
46      onEnd {
47            println "wizard ended"
48          }
49
50          // render the main wizard page
51          mainPage {
52            onRender {
53                  println "render main page"
54            }
55            render(view:"/wizard/index")
56        on("next") {
57          println "next page!"
58        }.to "pageTwo"
59      }
60
61      pageOne {
62            onRender {
63                  println "render page one"
64            }
65            render(view:"_one")
66        on("next") {
67          println "next page!"
68        }.to "pageTwo"
69      }
70
71          // render page two
72          pageTwo {
73            onRender {
74                  println "render page two"
75            }
76        render(view:"_two")
77        on("next") {
78          println "next page!"
79        }.to "pageThree"
80        on("previous") {
81          println "previous page!"
82        }.to "pageOne"
83          }
84
85          // render page three
86          pageThree {
87            onRender {
88                  println "render page three"
89            }
90        render(view:"_three")
91        on("previous") {
92          println "previous page!"
93        }.to "pageTwo"
94          }
95    }
96}
Note: See TracBrowser for help on using the repository browser.