1 /**
2 * Copyright 2005-2012 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.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/ecl2.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.krad.uif.container;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.core.api.config.property.ConfigurationService;
20 import org.kuali.rice.krad.service.KRADServiceLocator;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.view.View;
23 import org.kuali.rice.krad.uif.widget.Growls;
24 import org.kuali.rice.krad.util.ErrorMessage;
25 import org.kuali.rice.krad.util.GlobalVariables;
26 import org.kuali.rice.krad.util.MessageMap;
27 import org.springframework.util.AutoPopulatingList;
28
29 import java.text.MessageFormat;
30 import java.util.List;
31
32 /**
33 * @author Kuali Rice Team (rice.collab@kuali.org)
34 */
35 public class PageGroup extends Group {
36 private static final long serialVersionUID = 7571981300587270274L;
37
38 private boolean autoFocus;
39
40 /**
41 * Perform finalize here adds to its document ready script the
42 * setupValidator js function for setting up the validator for this view.
43 *
44 * @see org.kuali.rice.krad.uif.container.ContainerBase#performFinalize(org.kuali.rice.krad.uif.view.View,
45 * java.lang.Object, org.kuali.rice.krad.uif.component.Component)
46 */
47 @Override
48 public void performFinalize(View view, Object model, Component parent) {
49 super.performFinalize(view, model, parent);
50
51 String prefixScript = "";
52 if (this.getOnDocumentReadyScript() != null) {
53 prefixScript = this.getOnDocumentReadyScript();
54 }
55
56 this.setOnDocumentReadyScript(prefixScript + "\nsetupValidator();");
57 }
58
59 /**
60 * When this is true, the first field of the kualiForm will be focused by
61 * default, unless the parameter focusId is set on the form (by an
62 * actionField), then that field will be focused instead. When this setting
63 * if false, no field will be focused.
64 *
65 * @return the autoFocus
66 */
67 public boolean isAutoFocus() {
68 return this.autoFocus;
69 }
70
71 /**
72 * @param autoFocus the autoFocus to set
73 */
74 public void setAutoFocus(boolean autoFocus) {
75 this.autoFocus = autoFocus;
76 }
77
78 }