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

Last change on this file since 87 was 87, checked in by duh, 14 years ago
  • set keyword expansion
  • Property svn:keywords set to Rev Author Date
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: 87 $
17 * $Author: duh $
18 * $Date: 2010-01-13 15:54:59 +0000 (wo, 13 jan 2010) $
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.