1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.element;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.core.api.exception.RiceRuntimeException;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
23 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
24 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
25 import org.kuali.rice.krad.uif.UifConstants;
26 import org.kuali.rice.krad.uif.UifParameters;
27 import org.kuali.rice.krad.uif.UifPropertyPaths;
28 import org.kuali.rice.krad.uif.component.Component;
29 import org.kuali.rice.krad.uif.component.ComponentSecurity;
30 import org.kuali.rice.krad.uif.field.DataField;
31 import org.kuali.rice.krad.uif.service.ExpressionEvaluatorService;
32 import org.kuali.rice.krad.uif.util.ExpressionUtils;
33 import org.kuali.rice.krad.uif.util.ScriptUtils;
34 import org.kuali.rice.krad.uif.view.FormView;
35 import org.kuali.rice.krad.uif.view.View;
36
37 import java.util.ArrayList;
38 import java.util.HashMap;
39 import java.util.List;
40 import java.util.Map;
41
42
43
44
45
46
47
48 @BeanTags({@BeanTag(name = "action", parent = "Uif-Action"), @BeanTag(name = "actionImage", parent = "Uif-ActionImage"),
49 @BeanTag(name = "primaryActionButton", parent = "Uif-PrimaryActionButton"),
50 @BeanTag(name = "secondaryActionButton", parent = "Uif-SecondaryActionButton"),
51 @BeanTag(name = "primaryActionButton-small", parent = "Uif-PrimaryActionButton-Small"),
52 @BeanTag(name = "secondaryActionButton-small", parent = "Uif-SecondaryActionButton-Small"),
53 @BeanTag(name = "actionLink", parent = "Uif-ActionLink"),
54 @BeanTag(name = "navigationActionLink", parent = "Uif-NavigationActionLink"),
55 @BeanTag(name = "navigationActionButton", parent = "Uif-NavigationActionButton"),
56 @BeanTag(name = "secondaryNavigationActionButton", parent = "Uif-SecondaryNavigationActionButton"),
57 @BeanTag(name = "helpAction", parent = "Uif-HelpAction"),
58 @BeanTag(name = "saveAction", parent = "Uif-SaveAction"),
59 @BeanTag(name = "closeAction", parent = "Uif-CloseAction"),
60 @BeanTag(name = "cancelAction", parent = "Uif-CancelAction"),
61 @BeanTag(name = "checkFormAction", parent = "Uif-CheckFormAction"),
62 @BeanTag(name = "addLineAction", parent = "Uif-AddLineAction"),
63 @BeanTag(name = "deleteLineAction", parent = "Uif-DeleteLineAction"),
64 @BeanTag(name = "saveLineAction", parent = "Uif-SaveLineAction"),
65 @BeanTag(name = "addBlankLineAction", parent = "Uif-AddBlankLineAction"),
66 @BeanTag(name = "addViaLightBoxAction", parent = "Uif-AddViaLightBoxAction"),
67 @BeanTag(name = "toggleRowDetailsAction", parent = "Uif-ToggleRowDetailsAction"),
68 @BeanTag(name = "expandDetailsAction", parent = "Uif-ExpandDetailsAction"),
69 @BeanTag(name = "expandDetailsImageAction", parent = "Uif-ExpandDetailsImageAction"),
70 @BeanTag(name = "jumpToTopLink", parent = "Uif-JumpToTopLink"),
71 @BeanTag(name = "jumpToBottomLink", parent = "Uif-JumpToBottomLink"),
72 @BeanTag(name = "expandDisclosuresButton", parent = "Uif-ExpandDisclosuresButton"),
73 @BeanTag(name = "collapseDisclosuresButton", parent = "Uif-CollapseDisclosuresButton"),
74 @BeanTag(name = "showInactiveCollectionItemsButton", parent = "Uif-ShowInactiveCollectionItemsButton"),
75 @BeanTag(name = "hideInactiveCollectionItemsButton", parent = "Uif-HideInactiveCollectionItemsButton"),
76 @BeanTag(name = "collectionQuickFinderAction", parent = "Uif-CollectionQuickFinderAction")})
77 public class Action extends ContentElementBase {
78 private static final long serialVersionUID = 1025672792657238829L;
79
80 private String methodToCall;
81 private String actionEvent;
82 private String navigateToPageId;
83
84 private String actionScript;
85
86 private String actionLabel;
87 private Image actionImage;
88 private String actionImagePlacement;
89
90 private String jumpToIdAfterSubmit;
91 private String jumpToNameAfterSubmit;
92 private String focusOnIdAfterSubmit;
93
94 private boolean performClientSideValidation;
95 private boolean performDirtyValidation;
96
97 private String preSubmitCall;
98 private boolean ajaxSubmit;
99
100 private String ajaxReturnType;
101 private String refreshId;
102 private String refreshPropertyName;
103
104 private String successCallback;
105 private String errorCallback;
106
107 private String loadingMessageText;
108 private boolean disableBlocking;
109
110 private Map<String, String> additionalSubmitData;
111 private Map<String, String> actionParameters;
112
113 private boolean evaluateDisabledOnKeyUp;
114
115 private boolean disabled;
116 private String disabledReason;
117 private String disabledExpression;
118 private String disabledConditionJs;
119 private List<String> disabledConditionControlNames;
120
121 private List<String> disabledWhenChangedPropertyNames;
122 private List<String> enabledWhenChangedPropertyNames;
123
124 public Action() {
125 super();
126
127 actionImagePlacement = UifConstants.Position.LEFT.name();
128
129 ajaxSubmit = true;
130
131 successCallback = "";
132 errorCallback = "";
133 preSubmitCall = "";
134
135 additionalSubmitData = new HashMap<String, String>();
136 actionParameters = new HashMap<String, String>();
137
138 disabled = false;
139 disabledWhenChangedPropertyNames = new ArrayList<String>();
140 enabledWhenChangedPropertyNames = new ArrayList<String>();
141 }
142
143
144
145
146
147
148
149
150 public void performApplyModel(View view, Object model, Component parent) {
151 super.performApplyModel(view, model, parent);
152 disabledExpression = this.getPropertyExpression("disabled");
153 if (disabledExpression != null) {
154 ExpressionEvaluatorService expressionEvaluatorService =
155 KRADServiceLocatorWeb.getExpressionEvaluatorService();
156 disabledExpression = expressionEvaluatorService.replaceBindingPrefixes(view, this, disabledExpression);
157 disabled = (Boolean) expressionEvaluatorService.evaluateExpression(model, this.getContext(),
158 disabledExpression);
159 }
160 }
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 @Override
178 public void performFinalize(View view, Object model, Component parent) {
179 super.performFinalize(view, model, parent);
180
181 if (StringUtils.isNotEmpty(disabledExpression)
182 && !disabledExpression.equalsIgnoreCase("true")
183 && !disabledExpression.equalsIgnoreCase("false")) {
184 disabledConditionControlNames = new ArrayList<String>();
185 disabledConditionJs = ExpressionUtils.parseExpression(disabledExpression, disabledConditionControlNames);
186 }
187
188 List<String> adjustedDisablePropertyNames = new ArrayList<String>();
189 for (String propertyName : disabledWhenChangedPropertyNames) {
190 adjustedDisablePropertyNames.add(
191 KRADServiceLocatorWeb.getExpressionEvaluatorService().replaceBindingPrefixes(view, this,
192 propertyName));
193 }
194 disabledWhenChangedPropertyNames = adjustedDisablePropertyNames;
195
196 List<String> adjustedEnablePropertyNames = new ArrayList<String>();
197 for (String propertyName : enabledWhenChangedPropertyNames) {
198 adjustedEnablePropertyNames.add(
199 KRADServiceLocatorWeb.getExpressionEvaluatorService().replaceBindingPrefixes(view, this,
200 propertyName));
201 }
202 enabledWhenChangedPropertyNames = adjustedEnablePropertyNames;
203
204
205 if (actionImage != null && StringUtils.isNotBlank(actionImagePlacement) && StringUtils.isNotBlank(
206 actionLabel)) {
207 actionImage.setAltText("");
208 }
209
210 if (!actionParameters.containsKey(UifConstants.UrlParams.ACTION_EVENT) && StringUtils.isNotBlank(actionEvent)) {
211 actionParameters.put(UifConstants.UrlParams.ACTION_EVENT, actionEvent);
212 }
213
214 if (StringUtils.isNotBlank(navigateToPageId)) {
215 actionParameters.put(UifParameters.NAVIGATE_TO_PAGE_ID, navigateToPageId);
216 if (StringUtils.isBlank(methodToCall)) {
217 actionParameters.put(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME,
218 UifConstants.MethodToCallNames.NAVIGATE);
219 }
220 }
221
222 if (!actionParameters.containsKey(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME) && StringUtils
223 .isNotBlank(methodToCall)) {
224 actionParameters.put(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME, methodToCall);
225 }
226
227 setupRefreshAction(view);
228
229 buildActionData(view, model, parent);
230
231
232 String onClickScript = this.getOnClickScript();
233 if (StringUtils.isNotBlank(actionScript)) {
234 onClickScript = ScriptUtils.appendScript(onClickScript, actionScript);
235 } else {
236 onClickScript = ScriptUtils.appendScript(onClickScript, "actionInvokeHandler(this);");
237 }
238
239
240 if (view instanceof FormView) {
241 if (((FormView) view).isApplyDirtyCheck() && performDirtyValidation) {
242 onClickScript = "if (checkDirty(e) == false) { " + onClickScript + " ; } ";
243 }
244 }
245
246
247 if (disabled) {
248 this.addStyleClass("disabled");
249 this.setSkipInTabOrder(true);
250 }
251 onClickScript = "if(jQuery(this).hasClass('disabled')){ return false; }" + onClickScript;
252
253 setOnClickScript("e.preventDefault();" + onClickScript);
254 }
255
256
257
258
259
260
261
262 protected void setupRefreshAction(View view) {
263
264 if (StringUtils.isNotBlank(refreshPropertyName) || StringUtils.isNotBlank(refreshId)) {
265 ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATECOMPONENT.getKey();
266 }
267
268
269
270 Component refreshComponent = null;
271 if (StringUtils.isNotBlank(refreshPropertyName)) {
272
273 if (refreshPropertyName.startsWith(UifConstants.NO_BIND_ADJUST_PREFIX)) {
274 refreshPropertyName = StringUtils.removeStart(refreshPropertyName, UifConstants.NO_BIND_ADJUST_PREFIX);
275 } else if (StringUtils.isNotBlank(view.getDefaultBindingObjectPath())) {
276 refreshPropertyName = view.getDefaultBindingObjectPath() + "." + refreshPropertyName;
277 }
278
279 DataField dataField = view.getViewIndex().getDataFieldByPath(refreshPropertyName);
280 if (dataField != null) {
281 refreshComponent = dataField;
282 refreshId = refreshComponent.getId();
283 }
284 } else if (StringUtils.isNotBlank(refreshId)) {
285 Component component = view.getViewIndex().getComponentById(refreshId);
286 if (component != null) {
287 refreshComponent = component;
288 }
289 }
290
291 if (refreshComponent != null) {
292 refreshComponent.setRefreshedByAction(true);
293
294
295 Component initialComponent = view.getViewIndex().getInitialComponentStates().get(
296 refreshComponent.getBaseId());
297 if (initialComponent != null) {
298 initialComponent.setRefreshedByAction(true);
299 view.getViewIndex().getInitialComponentStates().put(refreshComponent.getBaseId(), initialComponent);
300 }
301 }
302 }
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317 protected void buildActionData(View view, Object model, Component parent) {
318
319 addDataAttribute("ajaxsubmit", Boolean.toString(ajaxSubmit));
320 addDataAttributeIfNonEmpty("successcallback", this.successCallback);
321 addDataAttributeIfNonEmpty("errorcallback", this.errorCallback);
322 addDataAttributeIfNonEmpty("presubmitcall", this.preSubmitCall);
323 addDataAttributeIfNonEmpty("loadingmessage", this.loadingMessageText);
324 addDataAttributeIfNonEmpty("disableblocking", Boolean.toString(this.disableBlocking));
325 addDataAttributeIfNonEmpty("ajaxreturntype", this.ajaxReturnType);
326 addDataAttributeIfNonEmpty("refreshid", this.refreshId);
327 addDataAttribute("validate", Boolean.toString(this.performClientSideValidation));
328
329
330 Map<String, String> submitData = new HashMap<String, String>();
331 for (String key : actionParameters.keySet()) {
332 String parameterPath = key;
333 if (!key.equals(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME)) {
334 parameterPath = UifPropertyPaths.ACTION_PARAMETERS + "[" + key + "]";
335 }
336 submitData.put(parameterPath, actionParameters.get(key));
337 }
338
339 for (String key : additionalSubmitData.keySet()) {
340 submitData.put(key, additionalSubmitData.get(key));
341 }
342
343
344
345 submitData.put(UifConstants.UrlParams.SHOW_HISTORY, "false");
346 submitData.put(UifConstants.UrlParams.SHOW_HOME, "false");
347
348
349 if (focusOnIdAfterSubmit.equalsIgnoreCase(UifConstants.Order.SELF.toString())) {
350 focusOnIdAfterSubmit = this.getId();
351 submitData.put("focusId", focusOnIdAfterSubmit);
352 } else if (focusOnIdAfterSubmit.equalsIgnoreCase(UifConstants.Order.NEXT_INPUT.toString())) {
353 focusOnIdAfterSubmit = UifConstants.Order.NEXT_INPUT.toString() + ":" + this.getId();
354 submitData.put("focusId", focusOnIdAfterSubmit);
355 } else {
356
357 submitData.put("focusId", focusOnIdAfterSubmit);
358 }
359
360
361 if (StringUtils.isBlank(jumpToIdAfterSubmit) && StringUtils.isBlank(jumpToNameAfterSubmit)) {
362 jumpToIdAfterSubmit = this.getId();
363 submitData.put("jumpToId", jumpToIdAfterSubmit);
364 } else if (StringUtils.isNotBlank(jumpToIdAfterSubmit)) {
365 submitData.put("jumpToId", jumpToIdAfterSubmit);
366 } else {
367 submitData.put("jumpToName", jumpToNameAfterSubmit);
368 }
369
370 addDataAttribute("submitData", ScriptUtils.toJSON(submitData));
371 }
372
373
374
375
376 @Override
377 public List<Component> getComponentsForLifecycle() {
378 List<Component> components = super.getComponentsForLifecycle();
379
380 components.add(actionImage);
381
382 return components;
383 }
384
385
386
387
388
389
390
391
392
393
394
395
396
397 @BeanTagAttribute(name = "methodToCall")
398 public String getMethodToCall() {
399 return this.methodToCall;
400 }
401
402
403
404
405
406
407 public void setMethodToCall(String methodToCall) {
408 this.methodToCall = methodToCall;
409 }
410
411
412
413
414
415
416
417
418
419
420
421
422 @BeanTagAttribute(name = "actionLabel")
423 public String getActionLabel() {
424 return this.actionLabel;
425 }
426
427
428
429
430
431
432 public void setActionLabel(String actionLabel) {
433 this.actionLabel = actionLabel;
434 }
435
436
437
438
439
440
441
442
443
444
445
446
447
448 @BeanTagAttribute(name = "actionImage", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
449 public Image getActionImage() {
450 return this.actionImage;
451 }
452
453
454
455
456
457
458 public void setActionImage(Image actionImage) {
459 this.actionImage = actionImage;
460 }
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476 @BeanTagAttribute(name = "navigateToPageId")
477 public String getNavigateToPageId() {
478 return this.navigateToPageId;
479 }
480
481
482
483
484
485
486 public void setNavigateToPageId(String navigateToPageId) {
487 this.navigateToPageId = navigateToPageId;
488 actionParameters.put(UifParameters.NAVIGATE_TO_PAGE_ID, navigateToPageId);
489 this.methodToCall = UifConstants.MethodToCallNames.NAVIGATE;
490 }
491
492
493
494
495
496
497
498
499
500
501
502
503 @BeanTagAttribute(name = "actionEvent")
504 public String getActionEvent() {
505 return actionEvent;
506 }
507
508
509
510
511
512
513 public void setActionEvent(String actionEvent) {
514 this.actionEvent = actionEvent;
515 }
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536 @BeanTagAttribute(name = "additionalSubmitData", type = BeanTagAttribute.AttributeType.MAPVALUE)
537 public Map<String, String> getAdditionalSubmitData() {
538 return additionalSubmitData;
539 }
540
541
542
543
544
545
546 public void setAdditionalSubmitData(Map<String, String> additionalSubmitData) {
547 this.additionalSubmitData = additionalSubmitData;
548 }
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566 @BeanTagAttribute(name = "actionParameters", type = BeanTagAttribute.AttributeType.MAPVALUE)
567 public Map<String, String> getActionParameters() {
568 return this.actionParameters;
569 }
570
571
572
573
574
575
576 public void setActionParameters(Map<String, String> actionParameters) {
577 this.actionParameters = actionParameters;
578 }
579
580
581
582
583
584
585
586 public void addActionParameter(String parameterName, String parameterValue) {
587 if (actionParameters == null) {
588 this.actionParameters = new HashMap<String, String>();
589 }
590
591 this.actionParameters.put(parameterName, parameterValue);
592 }
593
594
595
596
597 public String getActionParameter(String parameterName) {
598 return this.actionParameters.get(parameterName);
599 }
600
601
602
603
604
605
606 @Override
607 public void setComponentSecurity(ComponentSecurity componentSecurity) {
608 if (!(componentSecurity instanceof ActionSecurity)) {
609 throw new RiceRuntimeException("Component security for Action should be instance of ActionSecurity");
610 }
611
612 super.setComponentSecurity(componentSecurity);
613 }
614
615 @Override
616 protected Class<? extends ComponentSecurity> getComponentSecurityClass() {
617 return ActionSecurity.class;
618 }
619
620
621
622
623 @BeanTagAttribute(name = "jumpToIdAfterSubmit")
624 public String getJumpToIdAfterSubmit() {
625 return this.jumpToIdAfterSubmit;
626 }
627
628
629
630
631
632
633
634
635
636
637
638
639 public void setJumpToIdAfterSubmit(String jumpToIdAfterSubmit) {
640 this.jumpToIdAfterSubmit = jumpToIdAfterSubmit;
641 }
642
643
644
645
646
647
648
649
650
651
652
653 @BeanTagAttribute(name = "jumpToNameAfterSubmit")
654 public String getJumpToNameAfterSubmit() {
655 return this.jumpToNameAfterSubmit;
656 }
657
658
659
660
661 public void setJumpToNameAfterSubmit(String jumpToNameAfterSubmit) {
662 this.jumpToNameAfterSubmit = jumpToNameAfterSubmit;
663 }
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682 @BeanTagAttribute(name = "focusOnIdAfterSubmit")
683 public String getFocusOnIdAfterSubmit() {
684 return this.focusOnIdAfterSubmit;
685 }
686
687
688
689
690 public void setFocusOnIdAfterSubmit(String focusOnIdAfterSubmit) {
691 this.focusOnIdAfterSubmit = focusOnIdAfterSubmit;
692 }
693
694
695
696
697
698
699 @BeanTagAttribute(name = "performClientSideValidation")
700 public boolean isPerformClientSideValidation() {
701 return this.performClientSideValidation;
702 }
703
704
705
706
707
708
709 public void setPerformClientSideValidation(boolean performClientSideValidation) {
710 this.performClientSideValidation = performClientSideValidation;
711 }
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727 @BeanTagAttribute(name = "actionScript")
728 public String getActionScript() {
729 return this.actionScript;
730 }
731
732
733
734
735 public void setActionScript(String actionScript) {
736 if (!StringUtils.endsWith(actionScript, ";")) {
737 actionScript = actionScript + ";";
738 }
739 this.actionScript = actionScript;
740 }
741
742
743
744
745 public void setPerformDirtyValidation(boolean performDirtyValidation) {
746 this.performDirtyValidation = performDirtyValidation;
747 }
748
749
750
751
752 @BeanTagAttribute(name = "performDirtyValidation")
753 public boolean isPerformDirtyValidation() {
754 return performDirtyValidation;
755 }
756
757
758
759
760
761
762 @BeanTagAttribute(name = "disabled")
763 public boolean isDisabled() {
764 return disabled;
765 }
766
767
768
769
770
771
772 public void setDisabled(boolean disabled) {
773 this.disabled = disabled;
774 }
775
776
777
778
779
780
781
782
783 @BeanTagAttribute(name = "disabledReason")
784 public String getDisabledReason() {
785 return disabledReason;
786 }
787
788
789
790
791
792
793 public void setDisabledReason(String disabledReason) {
794 this.disabledReason = disabledReason;
795 }
796
797 @BeanTagAttribute(name = "actionImagePlacement")
798 public String getActionImagePlacement() {
799 return actionImagePlacement;
800 }
801
802
803
804
805
806
807
808
809
810 public void setActionImagePlacement(String actionImagePlacement) {
811 this.actionImagePlacement = actionImagePlacement;
812 }
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835 @BeanTagAttribute(name = "preSubmitCall")
836 public String getPreSubmitCall() {
837 return preSubmitCall;
838 }
839
840
841
842
843
844
845 public void setPreSubmitCall(String preSubmitCall) {
846 this.preSubmitCall = preSubmitCall;
847 }
848
849
850
851
852
853
854
855 @BeanTagAttribute(name = "ajaxSubmit")
856 public boolean isAjaxSubmit() {
857 return ajaxSubmit;
858 }
859
860
861
862
863
864
865 public void setAjaxSubmit(boolean ajaxSubmit) {
866 this.ajaxSubmit = ajaxSubmit;
867 }
868
869
870
871
872
873
874
875
876
877
878
879
880 @BeanTagAttribute(name = "ajaxReturnType")
881 public String getAjaxReturnType() {
882 return this.ajaxReturnType;
883 }
884
885
886
887
888
889
890 public void setAjaxReturnType(String ajaxReturnType) {
891 this.ajaxReturnType = ajaxReturnType;
892 }
893
894
895
896
897
898
899 @BeanTagAttribute(name = "displayResponseInLightBox")
900 public boolean isDisplayResponseInLightBox() {
901 return StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey());
902 }
903
904
905
906
907
908
909 public void setDisplayResponseInLightBox(boolean displayResponseInLightBox) {
910 if (displayResponseInLightBox) {
911 this.ajaxReturnType = UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey();
912 }
913
914 else if (StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey())) {
915 this.ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATEPAGE.getKey();
916 }
917 }
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938 @BeanTagAttribute(name = "successCallback")
939 public String getSuccessCallback() {
940 return successCallback;
941 }
942
943
944
945
946
947
948 public void setSuccessCallback(String successCallback) {
949 this.successCallback = successCallback;
950 }
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972 @BeanTagAttribute(name = "errorCallback")
973 public String getErrorCallback() {
974 return errorCallback;
975 }
976
977
978
979
980
981
982 public void setErrorCallback(String errorCallback) {
983 this.errorCallback = errorCallback;
984 }
985
986
987
988
989
990
991
992
993
994
995
996 @BeanTagAttribute(name = "refreshId")
997 public String getRefreshId() {
998 return refreshId;
999 }
1000
1001
1002
1003
1004
1005
1006 public void setRefreshId(String refreshId) {
1007 this.refreshId = refreshId;
1008 }
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026 @BeanTagAttribute(name = "refreshPropertyName")
1027 public String getRefreshPropertyName() {
1028 return refreshPropertyName;
1029 }
1030
1031
1032
1033
1034
1035
1036 public void setRefreshPropertyName(String refreshPropertyName) {
1037 this.refreshPropertyName = refreshPropertyName;
1038 }
1039
1040
1041
1042
1043
1044
1045 @BeanTagAttribute(name = "loadingMessageText")
1046 public String getLoadingMessageText() {
1047 return loadingMessageText;
1048 }
1049
1050
1051
1052
1053
1054
1055 public void setLoadingMessageText(String loadingMessageText) {
1056 this.loadingMessageText = loadingMessageText;
1057 }
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074 @BeanTagAttribute(name = "disableBlocking")
1075 public boolean isDisableBlocking() {
1076 return disableBlocking;
1077 }
1078
1079
1080
1081
1082
1083
1084 public void setDisableBlocking(boolean disableBlocking) {
1085 this.disableBlocking = disableBlocking;
1086 }
1087
1088
1089
1090
1091 @Override
1092 public void completeValidation(ValidationTrace tracer) {
1093 tracer.addBean(this);
1094
1095
1096 if (getActionLabel() == null && getActionImage() == null) {
1097 String currentValues[] = {"actionLabel =" + getActionLabel(), "actionImage =" + getActionImage()};
1098 tracer.createError("ActionLabel and/or actionImage must be set", currentValues);
1099 }
1100
1101
1102 if (getJumpToIdAfterSubmit() != null && getJumpToNameAfterSubmit() != null) {
1103 String currentValues[] = {"jumpToIdAfterSubmit =" + getJumpToIdAfterSubmit(),
1104 "jumpToNameAfterSubmit =" + getJumpToNameAfterSubmit()};
1105 tracer.createWarning("Only 1 jumpTo property should be set", currentValues);
1106 }
1107 super.completeValidation(tracer.getCopy());
1108 }
1109
1110
1111
1112
1113
1114
1115 @BeanTagAttribute(name = "evaluateDisabledOnKeyUp")
1116 public boolean isEvaluateDisabledOnKeyUp() {
1117 return evaluateDisabledOnKeyUp;
1118 }
1119
1120
1121
1122
1123
1124
1125 public void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp) {
1126 this.evaluateDisabledOnKeyUp = evaluateDisabledOnKeyUp;
1127 }
1128
1129
1130
1131
1132
1133
1134 public String getDisabledConditionJs() {
1135 return disabledConditionJs;
1136 }
1137
1138
1139
1140
1141
1142
1143 public List<String> getDisabledConditionControlNames() {
1144 return disabledConditionControlNames;
1145 }
1146
1147
1148
1149
1150
1151
1152 @BeanTagAttribute(name = "disabledWhenChangedPropertyNames", type = BeanTagAttribute.AttributeType.LISTVALUE)
1153 public List<String> getDisabledWhenChangedPropertyNames() {
1154 return disabledWhenChangedPropertyNames;
1155 }
1156
1157
1158
1159
1160
1161
1162 public void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames) {
1163 this.disabledWhenChangedPropertyNames = disabledWhenChangedPropertyNames;
1164 }
1165
1166
1167
1168
1169
1170
1171 @BeanTagAttribute(name = "enabledWhenChangedPropertyNames", type = BeanTagAttribute.AttributeType.LISTVALUE)
1172 public List<String> getEnabledWhenChangedPropertyNames() {
1173 return enabledWhenChangedPropertyNames;
1174 }
1175
1176
1177
1178
1179
1180
1181 public void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames) {
1182 this.enabledWhenChangedPropertyNames = enabledWhenChangedPropertyNames;
1183 }
1184 }