1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.field;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.core.api.exception.RiceRuntimeException;
20 import org.kuali.rice.core.api.util.type.TypeUtils;
21 import org.kuali.rice.krad.bo.DataObjectRelationship;
22 import org.kuali.rice.krad.bo.KualiCode;
23 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
24 import org.kuali.rice.krad.datadictionary.mask.MaskFormatter;
25 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
26 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
27 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
28 import org.kuali.rice.krad.datadictionary.validator.Validator;
29 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
30 import org.kuali.rice.krad.uif.UifConstants;
31 import org.kuali.rice.krad.uif.component.BindingInfo;
32 import org.kuali.rice.krad.uif.component.Component;
33 import org.kuali.rice.krad.uif.component.ComponentSecurity;
34 import org.kuali.rice.krad.uif.component.DataBinding;
35 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
36 import org.kuali.rice.krad.uif.util.ViewModelUtils;
37 import org.kuali.rice.krad.uif.view.View;
38 import org.kuali.rice.krad.uif.widget.Help;
39 import org.kuali.rice.krad.uif.widget.Helpable;
40 import org.kuali.rice.krad.uif.widget.Inquiry;
41 import org.kuali.rice.krad.uif.widget.Tooltip;
42 import org.kuali.rice.krad.util.KRADPropertyConstants;
43 import org.kuali.rice.krad.util.ObjectUtils;
44 import org.kuali.rice.krad.valuefinder.ValueFinder;
45
46 import java.beans.PropertyEditor;
47 import java.util.ArrayList;
48 import java.util.List;
49
50
51
52
53
54
55 @BeanTag(name = "dataField")
56 public class DataField extends FieldBase implements DataBinding, Helpable {
57 private static final long serialVersionUID = -4129678891948564724L;
58
59
60 private String propertyName;
61 private BindingInfo bindingInfo;
62
63 private String dictionaryAttributeName;
64 private String dictionaryObjectEntry;
65
66
67 private String defaultValue;
68 private Class<? extends ValueFinder> defaultValueFinderClass;
69 private Object[] defaultValues;
70
71 private PropertyEditor propertyEditor;
72
73 private boolean addHiddenWhenReadOnly;
74
75
76 protected String readOnlyDisplayReplacementPropertyName;
77 protected String readOnlyDisplaySuffixPropertyName;
78
79 private String readOnlyDisplayReplacement;
80 private String readOnlyDisplaySuffix;
81
82 private String readOnlyListDisplayType;
83 private String readOnlyListDelimiter;
84
85 private boolean applyMask;
86 private MaskFormatter maskFormatter;
87
88 private List<String> additionalHiddenPropertyNames;
89 private List<String> propertyNamesForAdditionalDisplay;
90
91 private boolean escapeHtmlInPropertyValue = true;
92 private boolean multiLineReadOnlyDisplay;
93
94 private Inquiry inquiry;
95 private Help help;
96
97 public DataField() {
98 super();
99
100 addHiddenWhenReadOnly = false;
101 applyMask = false;
102
103 additionalHiddenPropertyNames = new ArrayList<String>();
104 propertyNamesForAdditionalDisplay = new ArrayList<String>();
105 }
106
107
108
109
110
111
112
113
114
115
116
117
118 @Override
119 public void performInitialization(View view, Object model) {
120 super.performInitialization(view, model);
121
122 if (bindingInfo != null) {
123 bindingInfo.setDefaults(view, getPropertyName());
124 }
125 }
126
127
128
129
130
131
132
133
134 public void performApplyModel(View view, Object model, Component parent) {
135 super.performApplyModel(view, model, parent);
136
137 if (isAddHiddenWhenReadOnly()) {
138 setReadOnly(true);
139 getAdditionalHiddenPropertyNames().add(getPropertyName());
140 }
141 }
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157 @Override
158 public void performFinalize(View view, Object model, Component parent) {
159 super.performFinalize(view, model, parent);
160
161
162
163 List<String> hiddenPropertyPaths = new ArrayList<String>();
164 for (String hiddenPropertyName : getAdditionalHiddenPropertyNames()) {
165 String hiddenPropertyPath = getBindingInfo().getPropertyAdjustedBindingPath(hiddenPropertyName);
166 hiddenPropertyPaths.add(hiddenPropertyPath);
167 }
168 this.additionalHiddenPropertyNames = hiddenPropertyPaths;
169
170
171 List<String> informationalPropertyPaths = new ArrayList<String>();
172 for (String infoPropertyName : getPropertyNamesForAdditionalDisplay()) {
173 String infoPropertyPath = getBindingInfo().getPropertyAdjustedBindingPath(infoPropertyName);
174 informationalPropertyPaths.add(infoPropertyPath);
175 }
176 this.propertyNamesForAdditionalDisplay = informationalPropertyPaths;
177
178
179 Class<?> type = ObjectPropertyUtils.getPropertyType(model, getBindingInfo().getBindingPath());
180 if (this.isReadOnly() && type != null && List.class.isAssignableFrom(type) && StringUtils.isBlank(
181 getReadOnlyDisplayReplacement()) && StringUtils.isBlank(getReadOnlyDisplayReplacementPropertyName())) {
182
183 Object fieldValue = ObjectPropertyUtils.getPropertyValue(model, getBindingInfo().getBindingPath());
184
185
186 if (fieldValue != null && fieldValue instanceof List<?> && !((List) fieldValue).isEmpty()) {
187 List<?> list = (List<?>) fieldValue;
188 processReadOnlyListDisplay(model, list);
189 } else {
190 this.setReadOnlyDisplayReplacement(" ");
191 }
192
193 } else {
194
195 setAlternateAndAdditionalDisplayValue(view, model);
196 }
197
198 if (this.getFieldLabel() != null && StringUtils.isNotBlank(this.getId())) {
199 this.getFieldLabel().setLabelForComponentId(this.getId() + UifConstants.IdSuffixes.CONTROL);
200 }
201 }
202
203
204
205
206
207
208
209
210
211 protected void processReadOnlyListDisplay(Object model, List<?> originalList) {
212 generateReadOnlyListDisplayReplacement(originalList);
213 }
214
215
216
217
218
219
220
221
222 protected void generateReadOnlyListDisplayReplacement(List<?> list) {
223 String generatedHtml = "";
224
225
226 if (getReadOnlyListDisplayType() == null) {
227 this.setReadOnlyListDisplayType(UifConstants.ReadOnlyListTypes.DELIMITED.name());
228 }
229
230
231 if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.UL.name())) {
232 generatedHtml = "<ul class='uif-readOnlyStringList'>";
233 } else if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.OL.name())) {
234 generatedHtml = "<ol class='uif-readOnlyStringList'>";
235 } else if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.BREAK.name())) {
236 setReadOnlyListDelimiter("<br/>");
237 } else if (this.getReadOnlyListDelimiter() == null) {
238 setReadOnlyListDelimiter(", ");
239 }
240
241
242 for (Object value : list) {
243
244 if (!TypeUtils.isSimpleType(value.getClass()) || StringUtils.isBlank(value.toString())) {
245 continue;
246 }
247
248
249 if (isApplyMask()) {
250 value = getMaskFormatter().maskValue(value);
251 }
252
253
254 if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.UL.name())
255 || getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.OL.name())) {
256 generatedHtml = generatedHtml + "<li>" + value.toString() + "</li>";
257 }
258 else{
259
260 generatedHtml = generatedHtml + value.toString() + this.getReadOnlyListDelimiter();
261 }
262 }
263
264
265 if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.UL.name())) {
266 generatedHtml = generatedHtml + "</ul>";
267 } else if (getReadOnlyListDisplayType().equalsIgnoreCase(UifConstants.ReadOnlyListTypes.OL.name())) {
268 generatedHtml = generatedHtml + "</ol>";
269 } else {
270 generatedHtml = StringUtils.removeEnd(generatedHtml, this.getReadOnlyListDelimiter());
271 }
272
273 if(StringUtils.isNotBlank(generatedHtml)){
274 this.setReadOnlyDisplayReplacement(generatedHtml);
275 }
276 else{
277
278 this.setReadOnlyDisplayReplacement(" ");
279 }
280 }
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305 protected void setAlternateAndAdditionalDisplayValue(View view, Object model) {
306
307 if (StringUtils.isNotBlank(readOnlyDisplayReplacement) || StringUtils.isNotBlank(readOnlyDisplaySuffix)) {
308 return;
309 }
310
311
312 if (isApplyMask()) {
313 Object fieldValue = ObjectPropertyUtils.getPropertyValue(model, getBindingInfo().getBindingPath());
314 readOnlyDisplayReplacement = getMaskFormatter().maskValue(fieldValue);
315
316
317 setReadOnly(true);
318 return;
319 }
320
321
322 if (!isReadOnly()) {
323 return;
324 }
325
326
327 if (StringUtils.isNotBlank(getReadOnlyDisplayReplacementPropertyName())) {
328 String alternateDisplayPropertyPath = getBindingInfo().getPropertyAdjustedBindingPath(
329 getReadOnlyDisplayReplacementPropertyName());
330
331 Object alternateFieldValue = ObjectPropertyUtils.getPropertyValue(model, alternateDisplayPropertyPath);
332 if (alternateFieldValue != null) {
333
334 readOnlyDisplayReplacement = alternateFieldValue.toString();
335 }
336 }
337
338
339 if (StringUtils.isBlank(getReadOnlyDisplaySuffixPropertyName()) && view.isTranslateCodesOnReadOnlyDisplay()) {
340
341 Class<?> parentObjectClass = ViewModelUtils.getParentObjectClassForMetadata(view, model, this);
342 DataObjectRelationship relationship =
343 KRADServiceLocatorWeb.getDataObjectMetaDataService().getDataObjectRelationship(null,
344 parentObjectClass, getBindingInfo().getBindingName(), "", true, false, false);
345
346 if (relationship != null
347 && getPropertyName().startsWith(relationship.getParentAttributeName())
348 && KualiCode.class.isAssignableFrom(relationship.getRelatedClass())) {
349 readOnlyDisplaySuffixPropertyName =
350 relationship.getParentAttributeName() + "." + KRADPropertyConstants.NAME;
351 }
352 }
353
354
355 if (StringUtils.isNotBlank(getReadOnlyDisplaySuffixPropertyName())) {
356 String additionalDisplayPropertyPath = getBindingInfo().getPropertyAdjustedBindingPath(
357 getReadOnlyDisplaySuffixPropertyName());
358
359 Object additionalFieldValue = ObjectPropertyUtils.getPropertyValue(model, additionalDisplayPropertyPath);
360 if (additionalFieldValue != null) {
361
362 readOnlyDisplaySuffix = additionalFieldValue.toString();
363 }
364 }
365 }
366
367
368
369
370
371
372
373
374
375
376
377
378 public void copyFromAttributeDefinition(View view, AttributeDefinition attributeDefinition) {
379
380 if (StringUtils.isEmpty(getLabel())) {
381 setLabel(attributeDefinition.getLabel());
382 }
383
384
385 if (StringUtils.isEmpty(getShortLabel())) {
386 setShortLabel(attributeDefinition.getShortLabel());
387 }
388
389
390 if (getDataFieldSecurity().getAttributeSecurity() == null) {
391 getDataFieldSecurity().setAttributeSecurity(attributeDefinition.getAttributeSecurity());
392 }
393
394
395 if (getReadOnlyDisplayReplacementPropertyName() == null && StringUtils.isNotBlank(
396 attributeDefinition.getAlternateDisplayAttributeName())) {
397 setReadOnlyDisplayReplacementPropertyName(attributeDefinition.getAlternateDisplayAttributeName());
398 }
399
400
401 if (getReadOnlyDisplaySuffixPropertyName() == null && StringUtils.isNotBlank(
402 attributeDefinition.getAdditionalDisplayAttributeName())) {
403 setReadOnlyDisplaySuffixPropertyName(attributeDefinition.getAdditionalDisplayAttributeName());
404 }
405
406
407 if (getPropertyEditor() == null) {
408 setPropertyEditor(attributeDefinition.getPropertyEditor());
409 }
410 }
411
412
413
414
415 @Override
416 public List<Component> getComponentsForLifecycle() {
417 List<Component> components = super.getComponentsForLifecycle();
418
419 components.add(inquiry);
420 components.add(help);
421
422 return components;
423 }
424
425
426
427
428
429
430
431 public boolean isInputAllowed() {
432 return false;
433 }
434
435
436
437
438 @BeanTagAttribute(name = "propertyName")
439 public String getPropertyName() {
440 return this.propertyName;
441 }
442
443
444
445
446
447
448 public void setPropertyName(String propertyName) {
449 this.propertyName = propertyName;
450 }
451
452
453
454
455
456
457
458
459
460
461
462
463
464 @BeanTagAttribute(name = "propertyEditor", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
465 public PropertyEditor getPropertyEditor() {
466 return propertyEditor;
467 }
468
469
470
471
472
473
474 public void setPropertyEditor(PropertyEditor propertyEditor) {
475 this.propertyEditor = propertyEditor;
476 }
477
478
479
480
481
482
483 public void setPropertyEditorClass(Class<? extends PropertyEditor> propertyEditorClass) {
484 this.propertyEditor = ObjectUtils.newInstance(propertyEditorClass);
485 }
486
487
488
489
490 @BeanTagAttribute(name = "bindingInfo", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
491 public BindingInfo getBindingInfo() {
492 return this.bindingInfo;
493 }
494
495
496
497
498
499
500 public void setBindingInfo(BindingInfo bindingInfo) {
501 this.bindingInfo = bindingInfo;
502 }
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525 @BeanTagAttribute(name = "dictionaryAttributeName")
526 public String getDictionaryAttributeName() {
527 return this.dictionaryAttributeName;
528 }
529
530
531
532
533
534
535 public void setDictionaryAttributeName(String dictionaryAttributeName) {
536 this.dictionaryAttributeName = dictionaryAttributeName;
537 }
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559 @BeanTagAttribute(name = "dictionaryObjectEntry")
560 public String getDictionaryObjectEntry() {
561 return this.dictionaryObjectEntry;
562 }
563
564
565
566
567
568
569 public void setDictionaryObjectEntry(String dictionaryObjectEntry) {
570 this.dictionaryObjectEntry = dictionaryObjectEntry;
571 }
572
573
574
575
576
577
578
579
580
581
582
583
584 @BeanTagAttribute(name = "defaultValue")
585 public String getDefaultValue() {
586 return this.defaultValue;
587 }
588
589
590
591
592
593
594 public void setDefaultValue(String defaultValue) {
595 this.defaultValue = defaultValue;
596 }
597
598
599
600
601
602
603
604 @BeanTagAttribute(name = "defaultValueFinderClass")
605 public Class<? extends ValueFinder> getDefaultValueFinderClass() {
606 return this.defaultValueFinderClass;
607 }
608
609
610
611
612
613
614 public void setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass) {
615 this.defaultValueFinderClass = defaultValueFinderClass;
616 }
617
618
619
620
621
622
623
624
625
626
627
628
629 @BeanTagAttribute(name = "defaultValues", type = BeanTagAttribute.AttributeType.LISTBEAN)
630 public Object[] getDefaultValues() {
631 return this.defaultValues;
632 }
633
634
635
636
637
638
639 public void setDefaultValues(Object[] defaultValues) {
640 this.defaultValues = defaultValues;
641 }
642
643
644
645
646
647
648 @BeanTagAttribute(name = "helpSummary")
649 public String getHelpSummary() {
650 return this.help.getTooltipHelpContent();
651 }
652
653
654
655
656
657
658 public void setHelpSummary(String helpSummary) {
659 this.help.setTooltipHelpContent(helpSummary);
660 }
661
662
663
664
665
666
667 public DataFieldSecurity getDataFieldSecurity() {
668 return (DataFieldSecurity) super.getComponentSecurity();
669 }
670
671
672
673
674
675
676 @Override
677 public void setComponentSecurity(ComponentSecurity componentSecurity) {
678 if (!(componentSecurity instanceof DataFieldSecurity)) {
679 throw new RiceRuntimeException("Component security for DataField should be instance of DataFieldSecurity");
680 }
681
682 super.setComponentSecurity(componentSecurity);
683 }
684
685
686
687
688 @Override
689 protected Class<? extends ComponentSecurity> getComponentSecurityClass() {
690 return DataFieldSecurity.class;
691 }
692
693
694
695
696
697
698
699
700
701
702 @BeanTagAttribute(name = "addHiddenWhenReadOnly")
703 public boolean isAddHiddenWhenReadOnly() {
704 return addHiddenWhenReadOnly;
705 }
706
707
708
709
710
711
712 public void setAddHiddenWhenReadOnly(boolean addHiddenWhenReadOnly) {
713 this.addHiddenWhenReadOnly = addHiddenWhenReadOnly;
714 }
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729 @BeanTagAttribute(name = "inguiry", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
730 public Inquiry getInquiry() {
731 return this.inquiry;
732 }
733
734
735
736
737
738
739 public void setInquiry(Inquiry inquiry) {
740 this.inquiry = inquiry;
741 }
742
743
744
745
746
747
748
749
750
751
752
753
754 @Override
755 @BeanTagAttribute(name = "help", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
756 public Help getHelp() {
757 return this.help;
758 }
759
760
761
762
763
764
765 @Override
766 public void setHelp(Help help) {
767 this.help = help;
768 }
769
770
771
772
773
774
775 @Override
776 @BeanTagAttribute(name = "tooltipOfComponent", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
777 public void setTooltipOfComponent(Tooltip tooltip) {
778 getFieldLabel().setToolTip(tooltip);
779 }
780
781
782
783
784
785
786
787 @Override
788 public String getHelpTitle() {
789 return this.getLabel();
790 }
791
792
793
794
795
796
797
798 public void setReadOnlyDisplaySuffixPropertyName(String readOnlyDisplaySuffixPropertyName) {
799 this.readOnlyDisplaySuffixPropertyName = readOnlyDisplaySuffixPropertyName;
800 }
801
802
803
804
805
806
807 @BeanTagAttribute(name = "readOnlyDisplaceSuffixPropertyName")
808 public String getReadOnlyDisplaySuffixPropertyName() {
809 return this.readOnlyDisplaySuffixPropertyName;
810 }
811
812
813
814
815
816
817
818 public void setReadOnlyDisplayReplacementPropertyName(String readOnlyDisplayReplacementPropertyName) {
819 this.readOnlyDisplayReplacementPropertyName = readOnlyDisplayReplacementPropertyName;
820 }
821
822
823
824
825
826
827 @BeanTagAttribute(name = "readOnlyDisplayReplacementPropertyName")
828 public String getReadOnlyDisplayReplacementPropertyName() {
829 return this.readOnlyDisplayReplacementPropertyName;
830 }
831
832
833
834
835
836
837 @BeanTagAttribute(name = "readOnlyDisplayReplacement")
838 public String getReadOnlyDisplayReplacement() {
839 return readOnlyDisplayReplacement;
840 }
841
842
843
844
845
846
847 public void setReadOnlyDisplayReplacement(String value) {
848 this.readOnlyDisplayReplacement = value;
849 }
850
851
852
853
854
855
856 @BeanTagAttribute(name = "readOnlyDispalySuffix")
857 public String getReadOnlyDisplaySuffix() {
858 return readOnlyDisplaySuffix;
859 }
860
861
862
863
864
865
866 public void setReadOnlyDisplaySuffix(String value) {
867 this.readOnlyDisplaySuffix = value;
868 }
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885 public String getReadOnlyListDisplayType() {
886 return readOnlyListDisplayType;
887 }
888
889
890
891
892
893
894 public void setReadOnlyListDisplayType(String readOnlyListDisplayType) {
895 this.readOnlyListDisplayType = readOnlyListDisplayType;
896 }
897
898
899
900
901
902
903
904 public String getReadOnlyListDelimiter() {
905 return readOnlyListDelimiter;
906 }
907
908
909
910
911
912
913 public void setReadOnlyListDelimiter(String readOnlyListDelimiter) {
914 this.readOnlyListDelimiter = readOnlyListDelimiter;
915 }
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934 @BeanTagAttribute(name = "applyMask")
935 public boolean isApplyMask() {
936 return applyMask;
937 }
938
939
940
941
942
943
944 public void setApplyMask(boolean applyMask) {
945 this.applyMask = applyMask;
946 }
947
948
949
950
951
952
953
954
955
956
957
958 @BeanTagAttribute(name = "maskFormatter", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
959 public MaskFormatter getMaskFormatter() {
960 return maskFormatter;
961 }
962
963
964
965
966
967
968 public void setMaskFormatter(MaskFormatter maskFormatter) {
969 this.maskFormatter = maskFormatter;
970 }
971
972
973
974
975
976
977
978 @BeanTagAttribute(name = "additionalHiddenPropertyNames", type = BeanTagAttribute.AttributeType.LISTVALUE)
979 public List<String> getAdditionalHiddenPropertyNames() {
980 return additionalHiddenPropertyNames;
981 }
982
983
984
985
986
987
988 public void setAdditionalHiddenPropertyNames(List<String> additionalHiddenPropertyNames) {
989 this.additionalHiddenPropertyNames = additionalHiddenPropertyNames;
990 }
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010 @BeanTagAttribute(name = "propertyNamesForAdditionalDisplay", type = BeanTagAttribute.AttributeType.LISTVALUE)
1011 public List<String> getPropertyNamesForAdditionalDisplay() {
1012 return propertyNamesForAdditionalDisplay;
1013 }
1014
1015
1016
1017
1018
1019
1020 public void setPropertyNamesForAdditionalDisplay(List<String> propertyNamesForAdditionalDisplay) {
1021 this.propertyNamesForAdditionalDisplay = propertyNamesForAdditionalDisplay;
1022 }
1023
1024
1025
1026
1027
1028 public void setEscapeHtmlInPropertyValue(boolean escapeHtmlInPropertyValue) {
1029 this.escapeHtmlInPropertyValue = escapeHtmlInPropertyValue;
1030 }
1031
1032
1033
1034
1035
1036
1037 @BeanTagAttribute(name = "escapeHtmlInPropertyValue")
1038 public boolean isEscapeHtmlInPropertyValue() {
1039 return this.escapeHtmlInPropertyValue;
1040 }
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052 public boolean isMultiLineReadOnlyDisplay() {
1053 return multiLineReadOnlyDisplay;
1054 }
1055
1056
1057
1058
1059
1060
1061 public void setMultiLineReadOnlyDisplay(boolean multiLineReadOnlyDisplay) {
1062 this.multiLineReadOnlyDisplay = multiLineReadOnlyDisplay;
1063 }
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075 public boolean hasSecureValue() {
1076 return isApplyMask() || ((getComponentSecurity().isViewAuthz()
1077 || getDataFieldSecurity().isViewInLineAuthz()
1078 || ((getDataFieldSecurity().getAttributeSecurity() != null) && getDataFieldSecurity()
1079 .getAttributeSecurity().isHide())) && isHidden());
1080 }
1081
1082 public boolean isRenderFieldset() {
1083 return (!this.isReadOnly()
1084 && inquiry != null
1085 && inquiry.isRender()
1086 && inquiry.getInquiryLink() != null
1087 && inquiry.getInquiryLink().isRender()) || (help != null
1088 && help.isRender()
1089 && help.getHelpAction() != null
1090 && help.getHelpAction().isRender());
1091 }
1092
1093
1094
1095
1096 @Override
1097 public void completeValidation(ValidationTrace tracer) {
1098 tracer.addBean(this);
1099
1100
1101 if (getPropertyName() == null) {
1102 if (!Validator.checkExpressions(this, "propertyName")) {
1103 String currentValues[] = {"propertyName = " + getPropertyName()};
1104 tracer.createError("Property name not set", currentValues);
1105 }
1106 }
1107
1108
1109 if (getDefaultValue() != null && getDefaultValues() != null) {
1110 String currentValues[] =
1111 {"defaultValue =" + getDefaultValue(), "defaultValues Size =" + getDefaultValues().length};
1112 tracer.createWarning("Both Default Value and Default Values set", currentValues);
1113 }
1114
1115
1116 if (isApplyMask()) {
1117 if (maskFormatter == null) {
1118 String currentValues[] = {"applyMask =" + isApplyMask(), "maskFormatter =" + maskFormatter};
1119 tracer.createWarning("Apply mask is true, but no value is set for maskFormatter", currentValues);
1120 }
1121 }
1122
1123 super.completeValidation(tracer.getCopy());
1124 }
1125 }