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