1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.view;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
23 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
24 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
25 import org.kuali.rice.krad.uif.container.PageGroup;
26 import org.kuali.rice.krad.uif.util.LifecycleElement;
27 import org.kuali.rice.krad.web.form.UifFormBase;
28
29
30
31
32
33
34 @BeanTag(name = "view", parent = "Uif-FormView")
35 public class FormView extends View {
36 private static final long serialVersionUID = -3291164284675273147L;
37
38 private boolean renderForm;
39 private boolean validateServerSide;
40 private boolean validateClientSide;
41
42 private String formPostUrl;
43
44 private Map<String, String> additionalHiddenValues;
45
46 public FormView() {
47 renderForm = true;
48 validateServerSide = true;
49 validateClientSide = true;
50 applyDirtyCheck = true;
51
52 additionalHiddenValues = new HashMap<String, String>();
53 }
54
55
56
57
58
59
60
61
62
63
64
65 @Override
66 public void performFinalize(Object model, LifecycleElement parent) {
67 super.performFinalize(model, parent);
68
69 UifFormBase form = (UifFormBase) model;
70
71 PageGroup page = getCurrentPage();
72
73 if ((page != null) && StringUtils.isNotBlank(page.getFormPostUrl())) {
74 form.setFormPostUrl(page.getFormPostUrl());
75 }
76 else if (StringUtils.isNotBlank(formPostUrl)) {
77 form.setFormPostUrl(formPostUrl);
78 }
79 }
80
81
82
83
84
85
86
87
88
89
90 @BeanTagAttribute
91 public boolean isRenderForm() {
92 return this.renderForm;
93 }
94
95
96
97
98
99
100 public void setRenderForm(boolean renderForm) {
101 this.renderForm = renderForm;
102 }
103
104
105
106
107
108
109
110
111
112 @BeanTagAttribute
113 public boolean isValidateServerSide() {
114 return this.validateServerSide;
115 }
116
117
118
119
120
121
122 public void setValidateServerSide(boolean validateServerSide) {
123 this.validateServerSide = validateServerSide;
124 }
125
126
127
128
129
130
131
132 @BeanTagAttribute
133 public boolean isValidateClientSide() {
134 return validateClientSide;
135 }
136
137
138
139
140
141
142 public void setValidateClientSide(boolean validateClientSide) {
143 this.validateClientSide = validateClientSide;
144 }
145
146
147
148
149
150
151
152
153
154
155
156
157 @BeanTagAttribute
158 public String getFormPostUrl() {
159 return this.formPostUrl;
160 }
161
162
163
164
165
166
167 public void setFormPostUrl(String formPostUrl) {
168 this.formPostUrl = formPostUrl;
169 }
170
171
172
173
174
175
176
177 @BeanTagAttribute
178 public Map<String, String> getAdditionalHiddenValues() {
179 return additionalHiddenValues;
180 }
181
182
183
184
185 public void setAdditionalHiddenValues(Map<String, String> additionalHiddenValues) {
186 this.additionalHiddenValues = additionalHiddenValues;
187 }
188 }