1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.travel.krad.controller;
17
18 import javax.servlet.http.HttpServletRequest;
19 import javax.servlet.http.HttpServletResponse;
20
21 import org.kuali.rice.krad.web.controller.UifControllerBase;
22 import org.kuali.rice.krad.web.form.UifFormBase;
23 import org.springframework.stereotype.Controller;
24 import org.springframework.validation.BindingResult;
25 import org.springframework.web.bind.annotation.ModelAttribute;
26 import org.springframework.web.bind.annotation.RequestMapping;
27 import org.springframework.web.bind.annotation.RequestMethod;
28 import org.springframework.web.servlet.ModelAndView;
29
30 import edu.sampleu.travel.krad.form.UILayoutTestForm;
31
32
33
34
35
36
37 @Controller
38 @RequestMapping(value = "/uilayouttest")
39 public class UILayoutTestController extends UifControllerBase {
40
41
42
43
44 @Override
45 protected UILayoutTestForm createInitialForm(HttpServletRequest request) {
46 return new UILayoutTestForm();
47 }
48
49 @Override
50 @RequestMapping(params = "methodToCall=start")
51 public ModelAndView start(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
52 HttpServletRequest request, HttpServletResponse response) {
53 UILayoutTestForm uiTestForm = (UILayoutTestForm) form;
54
55 return super.start(uiTestForm, result, request, response);
56 }
57
58 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=save")
59 public ModelAndView save(@ModelAttribute("KualiForm") UILayoutTestForm uiTestForm, BindingResult result,
60 HttpServletRequest request, HttpServletResponse response) {
61
62 return getUIFModelAndView(uiTestForm, "page2");
63 }
64
65 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=close")
66 public ModelAndView close(@ModelAttribute("KualiForm") UILayoutTestForm uiTestForm, BindingResult result,
67 HttpServletRequest request, HttpServletResponse response) {
68
69 return getUIFModelAndView(uiTestForm, "page1");
70 }
71
72 }