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.uif.DataType;
20 import org.kuali.rice.core.api.util.ConcreteKeyValue;
21 import org.kuali.rice.core.api.util.KeyValue;
22 import org.kuali.rice.core.api.util.type.TypeUtils;
23 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
24 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
25 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
26 import org.kuali.rice.krad.datadictionary.state.StateMapping;
27 import org.kuali.rice.krad.datadictionary.validation.capability.CaseConstrainable;
28 import org.kuali.rice.krad.datadictionary.validation.capability.MustOccurConstrainable;
29 import org.kuali.rice.krad.datadictionary.validation.capability.PrerequisiteConstrainable;
30 import org.kuali.rice.krad.datadictionary.validation.capability.SimpleConstrainable;
31 import org.kuali.rice.krad.datadictionary.validation.capability.ValidCharactersConstrainable;
32 import org.kuali.rice.krad.datadictionary.validation.constraint.CaseConstraint;
33 import org.kuali.rice.krad.datadictionary.validation.constraint.MustOccurConstraint;
34 import org.kuali.rice.krad.datadictionary.validation.constraint.PrerequisiteConstraint;
35 import org.kuali.rice.krad.datadictionary.validation.constraint.SimpleConstraint;
36 import org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint;
37 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
38 import org.kuali.rice.krad.datadictionary.validator.Validator;
39 import org.kuali.rice.krad.keyvalues.KeyValuesFinder;
40 import org.kuali.rice.krad.uif.UifConstants;
41 import org.kuali.rice.krad.uif.component.Component;
42 import org.kuali.rice.krad.uif.control.Control;
43 import org.kuali.rice.krad.uif.control.MultiValueControlBase;
44 import org.kuali.rice.krad.uif.control.TextAreaControl;
45 import org.kuali.rice.krad.uif.control.TextControl;
46 import org.kuali.rice.krad.uif.control.UifKeyValuesFinder;
47 import org.kuali.rice.krad.uif.element.Label;
48 import org.kuali.rice.krad.uif.element.Message;
49 import org.kuali.rice.krad.uif.element.ValidationMessages;
50 import org.kuali.rice.krad.uif.util.ClientValidationUtils;
51 import org.kuali.rice.krad.uif.util.ComponentFactory;
52 import org.kuali.rice.krad.uif.util.ComponentUtils;
53 import org.kuali.rice.krad.uif.util.ConstraintStateUtils;
54 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
55 import org.kuali.rice.krad.uif.view.View;
56 import org.kuali.rice.krad.uif.view.ViewModel;
57 import org.kuali.rice.krad.uif.widget.QuickFinder;
58 import org.kuali.rice.krad.uif.widget.Suggest;
59 import org.kuali.rice.krad.util.ObjectUtils;
60
61 import java.util.ArrayList;
62 import java.util.List;
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 @BeanTag(name = "inputField")
83 public class InputField extends DataField implements SimpleConstrainable, CaseConstrainable, PrerequisiteConstrainable, MustOccurConstrainable, ValidCharactersConstrainable {
84 private static final long serialVersionUID = -3703656713706343840L;
85
86
87 private String customValidatorClass;
88 private ValidCharactersConstraint validCharactersConstraint;
89 private CaseConstraint caseConstraint;
90 private List<PrerequisiteConstraint> dependencyConstraints;
91 private List<MustOccurConstraint> mustOccurConstraints;
92 private SimpleConstraint simpleConstraint;
93 private DataType dataType;
94
95
96 private Control control;
97 private KeyValuesFinder optionsFinder;
98
99 private boolean uppercaseValue;
100
101 private ValidationMessages validationMessages;
102
103
104 private String constraintText;
105 private String instructionalText;
106
107 private Message constraintMessage;
108 private Message instructionalMessage;
109
110 private AttributeQuery attributeQuery;
111
112
113 private QuickFinder quickfinder;
114 private Suggest suggest;
115
116 public InputField() {
117 super();
118
119 simpleConstraint = new SimpleConstraint();
120 }
121
122
123
124
125
126
127
128
129
130
131
132 @Override
133 public void performInitialization(View view, Object model) {
134 super.performInitialization(view, model);
135
136 if ((StringUtils.isNotBlank(constraintText) || (getPropertyExpression("constraintText") != null)) && (
137 constraintMessage
138 == null)) {
139 constraintMessage = ComponentFactory.getConstraintMessage();
140 view.assignComponentIds(constraintMessage);
141 }
142
143 if ((StringUtils.isNotBlank(instructionalText) || (getPropertyExpression("instructionalText") != null)) && (
144 instructionalMessage
145 == null)) {
146 instructionalMessage = ComponentFactory.getInstructionalMessage();
147 view.assignComponentIds(instructionalMessage);
148 }
149
150 }
151
152
153
154
155 @Override
156 public void performApplyModel(View view, Object model, Component parent) {
157 super.performApplyModel(view, model, parent);
158
159
160
161 if (StringUtils.isNotBlank(instructionalText) && StringUtils.isBlank(instructionalMessage.getMessageText())) {
162 instructionalMessage.setMessageText(instructionalText);
163 }
164
165
166 if (StringUtils.isNotBlank(constraintText) && StringUtils.isBlank(constraintMessage.getMessageText())) {
167 constraintMessage.setMessageText(constraintText);
168 }
169
170
171 List<KeyValue> fieldOptions = new ArrayList<KeyValue>();
172
173
174 if ((control != null) && control instanceof MultiValueControlBase) {
175 MultiValueControlBase multiValueControl = (MultiValueControlBase) control;
176 if ((multiValueControl.getOptions() != null) && !multiValueControl.getOptions().isEmpty()) {
177 fieldOptions = multiValueControl.getOptions();
178 }
179 }
180
181
182 if (control instanceof TextAreaControl) {
183 setMultiLineReadOnlyDisplay(true);
184 }
185
186 if (fieldOptions.isEmpty() && (optionsFinder != null)) {
187 if (optionsFinder instanceof UifKeyValuesFinder) {
188 fieldOptions = ((UifKeyValuesFinder) optionsFinder).getKeyValues((ViewModel) model);
189
190
191 if (((UifKeyValuesFinder) optionsFinder).isAddBlankOption()) {
192 fieldOptions.add(0, new ConcreteKeyValue("", ""));
193 }
194 } else {
195 fieldOptions = optionsFinder.getKeyValues();
196 }
197
198 if ((control != null) && control instanceof MultiValueControlBase) {
199 ((MultiValueControlBase) control).setOptions(fieldOptions);
200 }
201 }
202
203
204 if (isReadOnly()
205 && !fieldOptions.isEmpty()
206 && StringUtils.isBlank(getReadOnlyDisplayReplacement())
207 && StringUtils.isBlank(getReadOnlyDisplaySuffix())
208 && StringUtils.isBlank(getReadOnlyDisplayReplacementPropertyName())
209 && StringUtils.isBlank(getReadOnlyDisplaySuffixPropertyName())) {
210
211 Object fieldValue = ObjectPropertyUtils.getPropertyValue(model, getBindingInfo().getBindingPath());
212
213
214 if ((fieldValue != null) && (TypeUtils.isSimpleType(fieldValue.getClass()))) {
215 for (KeyValue keyValue : fieldOptions) {
216 if (StringUtils.equals(fieldValue.toString(), keyValue.getKey())) {
217 setReadOnlyDisplayReplacement(keyValue.getValue());
218 break;
219 }
220 }
221 }
222 }
223 }
224
225
226
227
228
229
230
231
232
233
234
235
236
237 @Override
238 public void performFinalize(View view, Object model, Component parent) {
239 super.performFinalize(view, model, parent);
240
241 setupIds();
242 this.addDataAttribute("role", "InputField");
243
244
245 if (isReadOnly() || getControl() == null) {
246 return;
247 }
248
249
250 adjustPrerequisiteConstraintBinding(dependencyConstraints);
251
252
253 adjustMustOccurConstraintBinding(mustOccurConstraints);
254
255
256 if (caseConstraint != null) {
257 String propertyName = getBindingInfo().getPropertyAdjustedBindingPath(caseConstraint.getPropertyName());
258 caseConstraint.setPropertyName(propertyName);
259 }
260
261 setupFieldQuery();
262
263
264
265 String path = view.getStateObjectBindingPath();
266 Object stateObject;
267
268 if (StringUtils.isNotBlank(path)) {
269 stateObject = ObjectPropertyUtils.getPropertyValue(model, path);
270 } else {
271 stateObject = model;
272 }
273 StateMapping stateMapping = view.getStateMapping();
274
275 if (stateMapping != null) {
276 String validationState = ConstraintStateUtils.getClientViewValidationState(model, view);
277 SimpleConstraint appliedSimpleConstraint = ConstraintStateUtils.getApplicableConstraint(
278 this.getSimpleConstraint(), validationState, stateMapping);
279
280 if (appliedSimpleConstraint != null
281 && appliedSimpleConstraint.getRequired() != null
282 && appliedSimpleConstraint.getRequired()) {
283 SimpleConstraint prevConstraint = ConstraintStateUtils.getApplicableConstraint(
284 this.getSimpleConstraint(), stateMapping.getCurrentState(stateObject), stateMapping);
285 if (prevConstraint == null || prevConstraint.getRequired() == null || !prevConstraint.getRequired()) {
286 this.getFieldLabel().getRequiredMessage().setMessageText("**");
287 }
288 }
289 }
290
291 ClientValidationUtils.processAndApplyConstraints(this, view, model);
292 }
293
294
295
296
297
298
299
300
301
302 @Override
303 protected void processReadOnlyListDisplay(Object model, List<?> originalList) {
304
305 if ((control != null) && control instanceof MultiValueControlBase) {
306 List<String> newList = new ArrayList<String>();
307 List<KeyValue> fieldOptions = ((MultiValueControlBase) control).getOptions();
308
309 if (fieldOptions == null || fieldOptions.isEmpty()) {
310 return;
311 }
312
313 for (Object fieldValue : originalList) {
314 for (KeyValue keyValue : fieldOptions) {
315 if (fieldValue != null && StringUtils.equals(fieldValue.toString(), keyValue.getKey())) {
316 newList.add(keyValue.getValue());
317 break;
318 }
319 }
320 }
321 super.generateReadOnlyListDisplayReplacement(newList);
322 } else {
323 super.generateReadOnlyListDisplayReplacement(originalList);
324 }
325 }
326
327
328
329
330
331
332 protected void adjustMustOccurConstraintBinding(List<MustOccurConstraint> mustOccurConstraints) {
333 if (mustOccurConstraints != null) {
334 for (MustOccurConstraint mustOccurConstraint : mustOccurConstraints) {
335 adjustPrerequisiteConstraintBinding(mustOccurConstraint.getPrerequisiteConstraints());
336 adjustMustOccurConstraintBinding(mustOccurConstraint.getMustOccurConstraints());
337 }
338 }
339 }
340
341
342
343
344
345
346 protected void adjustPrerequisiteConstraintBinding(List<PrerequisiteConstraint> prerequisiteConstraints) {
347 if (prerequisiteConstraints != null) {
348 for (PrerequisiteConstraint prerequisiteConstraint : prerequisiteConstraints) {
349 String propertyName = getBindingInfo().getPropertyAdjustedBindingPath(
350 prerequisiteConstraint.getPropertyName());
351 prerequisiteConstraint.setPropertyName(propertyName);
352 }
353 }
354 }
355
356
357
358
359
360
361 protected void setupFieldQuery() {
362 if (getAttributeQuery() != null) {
363
364 getAttributeQuery().updateQueryFieldMapping(getBindingInfo());
365 getAttributeQuery().updateReturnFieldMapping(getBindingInfo());
366 getAttributeQuery().updateQueryMethodArgumentFieldList(getBindingInfo());
367
368
369 String script = "executeFieldQuery('" + getControl().getId() + "',";
370 script += "'" + getId() + "'," + getAttributeQuery().getQueryFieldMappingJsString() + ",";
371 script += getAttributeQuery().getQueryMethodArgumentFieldsJsString() + ",";
372 script += getAttributeQuery().getReturnFieldMappingJsString() + ");";
373
374 if (StringUtils.isNotBlank(getControl().getOnBlurScript())) {
375 script = getControl().getOnBlurScript() + script;
376 }
377 getControl().setOnBlurScript(script);
378 }
379 }
380
381
382
383
384
385
386 protected void setupIds() {
387
388
389 setNestedComponentIdAndSuffix(getControl(), UifConstants.IdSuffixes.CONTROL);
390 setNestedComponentIdAndSuffix(getValidationMessages(), UifConstants.IdSuffixes.ERRORS);
391 setNestedComponentIdAndSuffix(getFieldLabel(), UifConstants.IdSuffixes.LABEL);
392 setNestedComponentIdAndSuffix(getInstructionalMessage(), UifConstants.IdSuffixes.INSTRUCTIONAL);
393 setNestedComponentIdAndSuffix(getConstraintMessage(), UifConstants.IdSuffixes.CONSTRAINT);
394 setNestedComponentIdAndSuffix(getQuickfinder(), UifConstants.IdSuffixes.QUICK_FINDER);
395 setNestedComponentIdAndSuffix(getSuggest(), UifConstants.IdSuffixes.SUGGEST);
396
397 if (this.getControl() != null) {
398 this.getControl().addDataAttribute(UifConstants.DATA_ATTRIBUTE_CONTROL_FOR, this.getId());
399 }
400 }
401
402
403
404
405
406
407
408
409
410
411
412
413 @Override
414 public void copyFromAttributeDefinition(View view, AttributeDefinition attributeDefinition) {
415 super.copyFromAttributeDefinition(view, attributeDefinition);
416
417
418 if (getMaxLength() == null) {
419 setMaxLength(attributeDefinition.getMaxLength());
420 }
421
422
423 if (getMinLength() == null) {
424 setMinLength(attributeDefinition.getMinLength());
425 }
426
427
428 if (getValidCharactersConstraint() == null) {
429 setValidCharactersConstraint(attributeDefinition.getValidCharactersConstraint());
430 }
431
432 if (getCaseConstraint() == null) {
433 setCaseConstraint(attributeDefinition.getCaseConstraint());
434 }
435
436 if (getDependencyConstraints() == null) {
437 setDependencyConstraints(attributeDefinition.getPrerequisiteConstraints());
438 }
439
440 if (getMustOccurConstraints() == null) {
441 setMustOccurConstraints(attributeDefinition.getMustOccurConstraints());
442 }
443
444
445 if (getRequired() == null) {
446 setRequired(attributeDefinition.isRequired());
447
448
449 if (getRequired() == null) {
450 setRequired(Boolean.FALSE);
451 }
452 }
453
454 if (getDataType() == null) {
455 setDataType(attributeDefinition.getDataType());
456
457 if (getDataType() == null
458 && control instanceof TextControl
459 && ((TextControl) control).getDatePicker() != null) {
460 setDataType(DataType.DATE);
461 }
462 }
463
464
465 if ((getControl() == null) && (attributeDefinition.getControlField() != null)) {
466 Control control = attributeDefinition.getControlField();
467 view.assignComponentIds(control);
468
469 setControl(ComponentUtils.copy(control));
470 }
471
472
473 if (StringUtils.isEmpty(getConstraintText())) {
474 setConstraintText(attributeDefinition.getConstraintText());
475
476 if (constraintMessage == null) {
477 constraintMessage = ComponentFactory.getConstraintMessage();
478 view.assignComponentIds(constraintMessage);
479 }
480 getConstraintMessage().setMessageText(attributeDefinition.getConstraintText());
481 }
482
483
484 if (getOptionsFinder() == null) {
485 setOptionsFinder(attributeDefinition.getOptionsFinder());
486 }
487
488
489
490 if (this.getSimpleConstraint().getConstraintStateOverrides() == null) {
491 this.getSimpleConstraint().setConstraintStateOverrides(
492 attributeDefinition.getSimpleConstraint().getConstraintStateOverrides());
493 }
494
495 if (this.getSimpleConstraint().getStates().isEmpty()) {
496 this.getSimpleConstraint().setStates(attributeDefinition.getSimpleConstraint().getStates());
497 }
498
499 if (this.getSimpleConstraint().getMessageKey() == null) {
500 this.getSimpleConstraint().setMessageKey(attributeDefinition.getSimpleConstraint().getMessageKey());
501 }
502
503 if (this.getSimpleConstraint().getApplyClientSide() == null) {
504 this.getSimpleConstraint().setApplyClientSide(
505 attributeDefinition.getSimpleConstraint().getApplyClientSide());
506 }
507
508 if (this.getSimpleConstraint().getValidationMessageParams() == null) {
509 this.getSimpleConstraint().setValidationMessageParams(
510 attributeDefinition.getSimpleConstraint().getValidationMessageParams());
511 }
512 }
513
514
515
516
517 @Override
518 public List<Component> getComponentsForLifecycle() {
519 List<Component> components = super.getComponentsForLifecycle();
520
521 components.add(instructionalMessage);
522 components.add(constraintMessage);
523 components.add(control);
524 components.add(validationMessages);
525 components.add(quickfinder);
526 components.add(suggest);
527
528 return components;
529 }
530
531
532
533
534 @Override
535 public boolean isInputAllowed() {
536 return true;
537 }
538
539
540
541
542
543
544
545
546
547
548
549
550
551 @BeanTagAttribute(name = "control", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
552 public Control getControl() {
553 return this.control;
554 }
555
556
557
558
559
560
561 public void setControl(Control control) {
562 this.control = control;
563 }
564
565
566
567
568
569
570
571
572 @BeanTagAttribute(name = "validationMessages", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
573 public ValidationMessages getValidationMessages() {
574 return this.validationMessages;
575 }
576
577
578
579
580
581
582 public void setValidationMessages(ValidationMessages validationMessages) {
583 this.validationMessages = validationMessages;
584 }
585
586
587
588
589
590
591
592
593
594 @BeanTagAttribute(name = "optionsFinder", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
595 public KeyValuesFinder getOptionsFinder() {
596 return this.optionsFinder;
597 }
598
599
600
601
602
603
604 public void setOptionsFinder(KeyValuesFinder optionsFinder) {
605 this.optionsFinder = optionsFinder;
606 }
607
608
609
610
611
612
613
614 public void setOptionsFinderClass(Class<? extends KeyValuesFinder> optionsFinderClass) {
615 this.optionsFinder = ObjectUtils.newInstance(optionsFinderClass);
616 }
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632 @BeanTagAttribute(name = "quickfinder", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
633 public QuickFinder getQuickfinder() {
634 return this.quickfinder;
635 }
636
637
638
639
640
641
642 public void setQuickfinder(QuickFinder quickfinder) {
643 this.quickfinder = quickfinder;
644 }
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661 @BeanTagAttribute(name = "suggest", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
662 public Suggest getSuggest() {
663 return suggest;
664 }
665
666
667
668
669
670
671 public void setSuggest(Suggest suggest) {
672 this.suggest = suggest;
673 }
674
675
676
677
678
679
680
681
682
683
684
685 @BeanTagAttribute(name = "instructionalText")
686 public String getInstructionalText() {
687 return this.instructionalText;
688 }
689
690
691
692
693
694
695 public void setInstructionalText(String instructionalText) {
696 this.instructionalText = instructionalText;
697 }
698
699
700
701
702
703
704
705
706
707
708
709 @BeanTagAttribute(name = "instructionalMessage", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
710 public Message getInstructionalMessage() {
711 return this.instructionalMessage;
712 }
713
714
715
716
717
718
719
720
721
722
723
724 public void setInstructionalMessage(Message instructionalMessage) {
725 this.instructionalMessage = instructionalMessage;
726 }
727
728
729
730
731
732
733
734
735
736
737
738
739 @BeanTagAttribute(name = "constraintText")
740 public String getConstraintText() {
741 return this.constraintText;
742 }
743
744
745
746
747
748
749 public void setConstraintText(String constraintText) {
750 this.constraintText = constraintText;
751 }
752
753
754
755
756
757
758
759
760
761
762
763 @BeanTagAttribute(name = "constraintMessage", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
764 public Message getConstraintMessage() {
765 return this.constraintMessage;
766 }
767
768
769
770
771
772
773
774
775
776
777
778 public void setConstraintMessage(Message constraintMessage) {
779 this.constraintMessage = constraintMessage;
780 }
781
782
783
784
785
786
787 @Override
788 @BeanTagAttribute(name = "validCharactersConstraint", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
789 public ValidCharactersConstraint getValidCharactersConstraint() {
790 return this.validCharactersConstraint;
791 }
792
793
794
795
796
797
798 public void setValidCharactersConstraint(ValidCharactersConstraint validCharactersConstraint) {
799 this.validCharactersConstraint = validCharactersConstraint;
800 }
801
802
803
804
805
806
807 @Override
808 @BeanTagAttribute(name = "caseConstraint", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
809 public CaseConstraint getCaseConstraint() {
810 return this.caseConstraint;
811 }
812
813
814
815
816
817
818 public void setCaseConstraint(CaseConstraint caseConstraint) {
819 this.caseConstraint = caseConstraint;
820 }
821
822
823
824
825
826
827 @BeanTagAttribute(name = "dependencyConstraint", type = BeanTagAttribute.AttributeType.LISTBEAN)
828 public List<PrerequisiteConstraint> getDependencyConstraints() {
829 return this.dependencyConstraints;
830 }
831
832
833
834
835
836
837 public void setDependencyConstraints(List<PrerequisiteConstraint> dependencyConstraints) {
838 this.dependencyConstraints = dependencyConstraints;
839 }
840
841
842
843
844
845
846 @Override
847 @BeanTagAttribute(name = "mustOccurConstraints", type = BeanTagAttribute.AttributeType.LISTBEAN)
848 public List<MustOccurConstraint> getMustOccurConstraints() {
849 return this.mustOccurConstraints;
850 }
851
852
853
854
855
856
857 public void setMustOccurConstraints(List<MustOccurConstraint> mustOccurConstraints) {
858 this.mustOccurConstraints = mustOccurConstraints;
859 }
860
861
862
863
864
865
866
867
868
869
870
871 @Override
872 @BeanTagAttribute(name = "simpleConstraint", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
873 public SimpleConstraint getSimpleConstraint() {
874 return this.simpleConstraint;
875 }
876
877
878
879
880
881
882
883
884
885
886
887
888 public void setSimpleConstraint(SimpleConstraint simpleConstraint) {
889 this.simpleConstraint = simpleConstraint;
890 }
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905 @BeanTagAttribute(name = "maxLength")
906 public Integer getMaxLength() {
907 return simpleConstraint.getMaxLength();
908 }
909
910
911
912
913
914
915 public void setMaxLength(Integer maxLength) {
916 simpleConstraint.setMaxLength(maxLength);
917 }
918
919
920
921
922
923
924
925
926
927
928
929
930
931 @BeanTagAttribute(name = "minLength")
932 public Integer getMinLength() {
933 return simpleConstraint.getMinLength();
934 }
935
936
937
938
939
940
941 public void setMinLength(Integer minLength) {
942 simpleConstraint.setMinLength(minLength);
943 }
944
945
946
947
948 @Override
949 @BeanTagAttribute(name = "required")
950 public Boolean getRequired() {
951 return this.simpleConstraint.getRequired();
952 }
953
954
955
956
957 @Override
958 public void setRequired(Boolean required) {
959 this.simpleConstraint.setRequired(required);
960 }
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976 @BeanTagAttribute(name = "exclusiveMin")
977 public String getExclusiveMin() {
978 return simpleConstraint.getExclusiveMin();
979 }
980
981
982
983
984
985
986 public void setExclusiveMin(String exclusiveMin) {
987 simpleConstraint.setExclusiveMin(exclusiveMin);
988 }
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004 @BeanTagAttribute(name = "inclusiveMax")
1005 public String getInclusiveMax() {
1006 return simpleConstraint.getInclusiveMax();
1007 }
1008
1009
1010
1011
1012
1013
1014 public void setInclusiveMax(String inclusiveMax) {
1015 simpleConstraint.setInclusiveMax(inclusiveMax);
1016 }
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032 @BeanTagAttribute(name = "attributeQuery", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1033 public AttributeQuery getAttributeQuery() {
1034 return attributeQuery;
1035 }
1036
1037
1038
1039
1040
1041
1042 public void setAttributeQuery(AttributeQuery attributeQuery) {
1043 this.attributeQuery = attributeQuery;
1044 }
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056 @BeanTagAttribute(name = "uppercaseValue")
1057 public boolean isUppercaseValue() {
1058 return uppercaseValue;
1059 }
1060
1061
1062
1063
1064
1065
1066 public void setUppercaseValue(boolean uppercaseValue) {
1067 this.uppercaseValue = uppercaseValue;
1068 }
1069
1070
1071
1072
1073
1074
1075
1076 @Override
1077 public String getName() {
1078 return this.getBindingInfo().getBindingPath();
1079 }
1080
1081 @Override
1082 public List<PrerequisiteConstraint> getPrerequisiteConstraints() {
1083 return dependencyConstraints;
1084 }
1085
1086
1087
1088
1089
1090
1091
1092 public void setDataType(DataType dataType) {
1093 this.simpleConstraint.setDataType(dataType);
1094 }
1095
1096 public void setDataType(String dataType) {
1097 this.simpleConstraint.setDataType(DataType.valueOf(dataType));
1098 }
1099
1100
1101
1102
1103
1104
1105
1106
1107 @BeanTagAttribute(name = "dataType", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1108 public DataType getDataType() {
1109 return this.simpleConstraint.getDataType();
1110 }
1111
1112 @Override
1113 public boolean isRenderFieldset() {
1114 return super.isRenderFieldset() || (this.isInputAllowed()
1115 && quickfinder != null
1116 && quickfinder.isRender()
1117 && quickfinder.getQuickfinderAction() != null
1118 && quickfinder.getQuickfinderAction().isRender());
1119 }
1120
1121
1122
1123
1124 @Override
1125 public void completeValidation(ValidationTrace tracer) {
1126 tracer.addBean(this);
1127
1128
1129 if (getControl() == null) {
1130 if (Validator.checkExpressions(this, "control")) {
1131 String currentValues[] = {"control =" + getConstraintText()};
1132 tracer.createWarning("Control should be set", currentValues);
1133 }
1134 }
1135
1136 super.completeValidation(tracer.getCopy());
1137 }
1138 }