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 edu.sampleu.demo.kitchensink.UifComponentsTestForm;
22 import org.kuali.rice.krad.web.controller.UifControllerBase;
23 import org.kuali.rice.krad.web.form.UifFormBase;
24 import org.springframework.stereotype.Controller;
25 import org.springframework.validation.BindingResult;
26 import org.springframework.web.bind.annotation.ModelAttribute;
27 import org.springframework.web.bind.annotation.RequestMapping;
28 import org.springframework.web.bind.annotation.RequestMethod;
29 import org.springframework.web.servlet.ModelAndView;
30
31
32
33
34
35
36 @Controller
37 @RequestMapping(value = "/uilayouttest")
38 public class UILayoutTestController extends UifControllerBase {
39
40
41
42
43 @Override
44 protected UifComponentsTestForm createInitialForm(HttpServletRequest request) {
45 return new UifComponentsTestForm();
46 }
47
48 @Override
49 @RequestMapping(params = "methodToCall=start")
50 public ModelAndView start(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
51 HttpServletRequest request, HttpServletResponse response) {
52 UifComponentsTestForm uiTestForm = (UifComponentsTestForm) form;
53
54 return super.start(uiTestForm, result, request, response);
55 }
56
57 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=save")
58 public ModelAndView save(@ModelAttribute("KualiForm") UifComponentsTestForm uiTestForm, BindingResult result,
59 HttpServletRequest request, HttpServletResponse response) {
60
61 return getUIFModelAndView(uiTestForm, "page2");
62 }
63
64 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=close")
65 public ModelAndView close(@ModelAttribute("KualiForm") UifComponentsTestForm uiTestForm, BindingResult result,
66 HttpServletRequest request, HttpServletResponse response) {
67
68 return getUIFModelAndView(uiTestForm, "page1");
69 }
70
71 }