1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.container;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
21 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.view.FormView;
24 import org.kuali.rice.krad.uif.view.View;
25
26
27
28
29 @BeanTags({@BeanTag(name = "page-bean", parent = "Uif-Page"),
30 @BeanTag(name = "disclosure-page-bean", parent = "Uif-Disclosure-Page"),
31 @BeanTag(name = "documentPage-bean", parent = "Uif-DocumentPage"),
32 @BeanTag(name = "inquiryPage-bean", parent = "Uif-InquiryPage"),
33 @BeanTag(name = "lookupPage-bean", parent = "Uif-LookupPage"),
34 @BeanTag(name = "maintenancePage-bean", parent = "Uif-MaintenancePage")})
35 public class PageGroup extends Group {
36 private static final long serialVersionUID = 7571981300587270274L;
37
38 private boolean autoFocus = false;
39
40
41
42
43
44
45
46
47 @Override
48 public void performFinalize(View view, Object model, Component parent) {
49 super.performFinalize(view, model, parent);
50
51 this.addDataAttribute("type", "Page");
52
53 String prefixScript = "";
54 if (this.getOnDocumentReadyScript() != null) {
55 prefixScript = this.getOnDocumentReadyScript();
56 }
57
58 if (view instanceof FormView && ((FormView) view).isValidateClientSide()) {
59 this.setOnDocumentReadyScript(prefixScript + "\nsetupPage(true);");
60 } else {
61 this.setOnDocumentReadyScript(prefixScript + "\nsetupPage(false);");
62 }
63 }
64
65
66
67
68
69
70
71
72
73 @BeanTagAttribute(name = "autoFocus")
74 public boolean isAutoFocus() {
75 return this.autoFocus;
76 }
77
78
79
80
81 public void setAutoFocus(boolean autoFocus) {
82 this.autoFocus = autoFocus;
83 }
84
85
86
87
88 @Override
89 public void completeValidation(ValidationTrace tracer) {
90 tracer.addBean(this);
91
92
93 for (int i = 0; i < getItems().size(); i++) {
94 if (getItems().get(i).getClass() == PageGroup.class || getItems().get(i).getClass()
95 == NavigationGroup.class) {
96 String currentValues[] = {"item(" + i + ").class =" + getItems().get(i).getClass()};
97 tracer.createError("Items in PageGroup cannot be PageGroup or NaviagtionGroup", currentValues);
98 }
99 }
100
101 super.completeValidation(tracer.getCopy());
102 }
103 }