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.List;
19
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.element.Iframe;
24 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
25 import org.kuali.rice.krad.uif.util.ComponentFactory;
26 import org.kuali.rice.krad.uif.util.LifecycleElement;
27 import org.kuali.rice.krad.uif.util.UrlInfo;
28
29
30
31
32
33
34
35
36
37
38
39
40 @BeanTag(name = "iframeView", parent = "Uif-IframeView")
41 public class IframeView extends FormView {
42 private UrlInfo location;
43 private Iframe iframe;
44
45
46
47
48
49
50 @Override
51 public void performInitialization(Object model) {
52 super.performInitialization(model);
53
54 super.setSinglePageView(true);
55
56 List<Component> modifiedItems = (List<Component>) this.getPage().getItems();
57 modifiedItems.add(iframe);
58 this.getPage().setItems(modifiedItems);
59 }
60
61
62
63
64
65
66 @Override
67 public void performApplyModel(Object model, LifecycleElement parent) {
68 super.performApplyModel(model, parent);
69
70 if (location != null) {
71 ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(location, false);
72 ViewLifecycle.getExpressionEvaluator().evaluateExpressionsOnConfigurable(this, location, this.getContext());
73
74 iframe.setSource(location.getHref());
75 }
76 }
77
78
79
80
81
82
83 @BeanTagAttribute
84 public UrlInfo getLocation() {
85 return location;
86 }
87
88
89
90
91 public void setLocation(UrlInfo location) {
92 this.location = location;
93 }
94
95
96
97
98 @BeanTagAttribute
99 public String getHref() {
100 if (this.location != null) {
101 return this.location.getHref();
102 }
103
104 return null;
105 }
106
107
108
109
110 public void setHref(String href) {
111 if (this.location == null) {
112 this.location = ComponentFactory.getUrlInfo();
113 }
114
115 this.location.setHref(href);
116 }
117
118
119
120
121
122
123
124 @BeanTagAttribute
125 public Iframe getIframe() {
126 return iframe;
127 }
128
129
130
131
132 public void setIframe(Iframe iframe) {
133 this.iframe = iframe;
134 }
135 }