Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FormView |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl1.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kns.uif.container; | |
17 | ||
18 | /** | |
19 | * Provides configuration for <code>View</code> instances that render an HTML | |
20 | * form | |
21 | * | |
22 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
23 | */ | |
24 | public class FormView extends View { | |
25 | private static final long serialVersionUID = -3291164284675273147L; | |
26 | ||
27 | private boolean renderForm; | |
28 | private boolean validateServerSide; | |
29 | private boolean validateClientSide; | |
30 | ||
31 | private String formPostUrl; | |
32 | ||
33 | 0 | public FormView() { |
34 | 0 | renderForm = true; |
35 | 0 | validateServerSide = true; |
36 | 0 | validateClientSide = true; |
37 | 0 | } |
38 | ||
39 | /** | |
40 | * Indicates whether a Form element should be rendered for the View. This is | |
41 | * necessary for pages that need to submit data back to the server. Note | |
42 | * that even if a page is read-only, a form element is generally needed for | |
43 | * the navigation. Defaults to true | |
44 | * | |
45 | * @return true if the form element should be rendered, false if it should | |
46 | * not be | |
47 | */ | |
48 | public boolean isRenderForm() { | |
49 | 0 | return this.renderForm; |
50 | } | |
51 | ||
52 | /** | |
53 | * Setter for the render form indicator | |
54 | * | |
55 | * @param renderForm | |
56 | */ | |
57 | public void setRenderForm(boolean renderForm) { | |
58 | 0 | this.renderForm = renderForm; |
59 | 0 | } |
60 | ||
61 | /** | |
62 | * Indicates whether to perform the validate model phase of the view | |
63 | * lifecycle. This phase will validate the model against configured | |
64 | * dictionary validations and report errors. Defaults to true | |
65 | * | |
66 | * @return boolean true if model data should be validated, false if it | |
67 | * should not be | |
68 | * @see | |
69 | */ | |
70 | public boolean isValidateServerSide() { | |
71 | 0 | return this.validateServerSide; |
72 | } | |
73 | ||
74 | /** | |
75 | * Setter for the validate server side indicator | |
76 | * | |
77 | * @param validateServerSide | |
78 | */ | |
79 | public void setValidateServerSide(boolean validateServerSide) { | |
80 | 0 | this.validateServerSide = validateServerSide; |
81 | 0 | } |
82 | ||
83 | /** | |
84 | * Indicates whether to perform on-the-fly validation on the client using js | |
85 | * during user data entry. Defaults to true | |
86 | * | |
87 | * @return the validateClientSide | |
88 | */ | |
89 | public boolean isValidateClientSide() { | |
90 | 0 | return validateClientSide; |
91 | } | |
92 | ||
93 | /** | |
94 | * Setter for the validate client side indicator | |
95 | * | |
96 | * @param validateClientSide | |
97 | */ | |
98 | public void setValidateClientSide(boolean validateClientSide) { | |
99 | 0 | this.validateClientSide = validateClientSide; |
100 | 0 | } |
101 | ||
102 | /** | |
103 | * Specifies the URL the view's form should post to | |
104 | * | |
105 | * <p> | |
106 | * Any valid form post URL (full or relative) can be specified. If left | |
107 | * empty, the form will be posted to the same URL of the preceding request | |
108 | * URL. | |
109 | * </p> | |
110 | * | |
111 | * @return String post URL | |
112 | */ | |
113 | public String getFormPostUrl() { | |
114 | 0 | return this.formPostUrl; |
115 | } | |
116 | ||
117 | /** | |
118 | * Setter for the form post URL | |
119 | * | |
120 | * @param formPostUrl | |
121 | */ | |
122 | public void setFormPostUrl(String formPostUrl) { | |
123 | 0 | this.formPostUrl = formPostUrl; |
124 | 0 | } |
125 | ||
126 | } |