1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.lifecycle.model;
17
18 import org.kuali.rice.krad.uif.component.Component;
19 import org.kuali.rice.krad.uif.field.DataField;
20 import org.kuali.rice.krad.uif.lifecycle.LifecycleElementState;
21 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
22 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycleTaskBase;
23 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
24
25
26
27
28 public class RefreshStateModifyTask extends ViewLifecycleTaskBase<Component> {
29
30
31
32
33 public RefreshStateModifyTask() {
34 super(Component.class);
35 }
36
37
38
39
40 @Override
41 protected void performLifecycleTask() {
42 LifecycleElementState phase = getElementState();
43 if (!ViewLifecycle.isRefreshComponent(phase.getViewPhase(), phase.getViewPath())) {
44 return;
45 }
46
47 Component component = (Component) getElementState().getElement();
48
49
50 component.setRender(true);
51
52
53 if (component.isResetDataOnRefresh()) {
54
55 if (component instanceof DataField) {
56
57
58
59 ObjectPropertyUtils.initializeProperty(ViewLifecycle.getModel(),
60 ((DataField) component).getBindingInfo().getBindingPath());
61 }
62 }
63 }
64
65 }