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.field.DataFieldSecurity;
32 import org.kuali.rice.krad.uif.service.ExpressionEvaluatorService;
33 import org.kuali.rice.krad.uif.util.ExpressionUtils;
34 import org.kuali.rice.krad.uif.util.ScriptUtils;
35 import org.kuali.rice.krad.uif.view.FormView;
36 import org.kuali.rice.krad.uif.view.View;
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 = "closeAction-bean", parent = "Uif-CloseAction"),
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 setOnClickScript("e.preventDefault();" + onClickScript);
257 }
258
259
260
261
262
263
264
265 protected void setupRefreshAction(View view) {
266
267
268 if (StringUtils.isNotBlank(refreshPropertyName) || StringUtils.isNotBlank(refreshId)) {
269 ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATECOMPONENT.getKey();
270 }
271
272
273
274 Component refreshComponent = null;
275 if (StringUtils.isNotBlank(refreshPropertyName)) {
276
277 if (refreshPropertyName.startsWith(UifConstants.NO_BIND_ADJUST_PREFIX)) {
278 refreshPropertyName = StringUtils.removeStart(refreshPropertyName, UifConstants.NO_BIND_ADJUST_PREFIX);
279 } else if (StringUtils.isNotBlank(view.getDefaultBindingObjectPath())) {
280 refreshPropertyName = view.getDefaultBindingObjectPath() + "." + refreshPropertyName;
281 }
282
283 DataField dataField = view.getViewIndex().getDataFieldByPath(refreshPropertyName);
284 if (dataField != null) {
285 refreshComponent = dataField;
286 refreshId = refreshComponent.getId();
287 }
288 } else if (StringUtils.isNotBlank(refreshId)) {
289 Component component = view.getViewIndex().getComponentById(refreshId);
290 if (component != null) {
291 refreshComponent = component;
292 }
293 }
294
295 if (refreshComponent != null) {
296 refreshComponent.setRefreshedByAction(true);
297
298
299 Component initialComponent = view.getViewIndex().getInitialComponentStates().get(
300 refreshComponent.getBaseId());
301 if (initialComponent != null) {
302 initialComponent.setRefreshedByAction(true);
303 view.getViewIndex().getInitialComponentStates().put(refreshComponent.getBaseId(), initialComponent);
304 }
305 }
306 }
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321 protected void buildActionData(View view, Object model, Component parent) {
322
323 addDataAttribute("ajaxsubmit", Boolean.toString(ajaxSubmit));
324 addDataAttributeIfNonEmpty("successcallback", this.successCallback);
325 addDataAttributeIfNonEmpty("errorcallback", this.errorCallback);
326 addDataAttributeIfNonEmpty("presubmitcall", this.preSubmitCall);
327 addDataAttributeIfNonEmpty("loadingmessage", this.loadingMessageText);
328 addDataAttributeIfNonEmpty("disableblocking", Boolean.toString(this.disableBlocking));
329 addDataAttributeIfNonEmpty("ajaxreturntype", this.ajaxReturnType);
330 addDataAttributeIfNonEmpty("refreshid", this.refreshId);
331 addDataAttribute("validate", Boolean.toString(this.performClientSideValidation));
332
333
334 Map<String, String> submitData = new HashMap<String, String>();
335 for (String key : actionParameters.keySet()) {
336 String parameterPath = key;
337 if (!key.equals(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME)) {
338 parameterPath = UifPropertyPaths.ACTION_PARAMETERS + "[" + key + "]";
339 }
340 submitData.put(parameterPath, actionParameters.get(key));
341 }
342
343 for (String key : additionalSubmitData.keySet()) {
344 submitData.put(key, additionalSubmitData.get(key));
345 }
346
347
348
349 submitData.put(UifConstants.UrlParams.SHOW_HISTORY, "false");
350 submitData.put(UifConstants.UrlParams.SHOW_HOME, "false");
351
352
353 if (focusOnIdAfterSubmit.equalsIgnoreCase(UifConstants.Order.SELF.toString())) {
354 focusOnIdAfterSubmit = this.getId();
355 submitData.put("focusId", focusOnIdAfterSubmit);
356 } else if (focusOnIdAfterSubmit.equalsIgnoreCase(UifConstants.Order.NEXT_INPUT.toString())) {
357 focusOnIdAfterSubmit = UifConstants.Order.NEXT_INPUT.toString() + ":" + this.getId();
358 submitData.put("focusId", focusOnIdAfterSubmit);
359 } else {
360
361 submitData.put("focusId", focusOnIdAfterSubmit);
362 }
363
364
365 if (StringUtils.isBlank(jumpToIdAfterSubmit) && StringUtils.isBlank(jumpToNameAfterSubmit)) {
366 jumpToIdAfterSubmit = this.getId();
367 submitData.put("jumpToId", jumpToIdAfterSubmit);
368 } else if (StringUtils.isNotBlank(jumpToIdAfterSubmit)) {
369 submitData.put("jumpToId", jumpToIdAfterSubmit);
370 } else {
371 submitData.put("jumpToName", jumpToNameAfterSubmit);
372 }
373
374 addDataAttribute("submitData", ScriptUtils.toJSON(submitData));
375 }
376
377
378
379
380 @Override
381 public List<Component> getComponentsForLifecycle() {
382 List<Component> components = super.getComponentsForLifecycle();
383
384 components.add(actionImage);
385
386 return components;
387 }
388
389
390
391
392
393
394
395
396
397
398
399
400
401 @BeanTagAttribute(name = "methodToCall")
402 public String getMethodToCall() {
403 return this.methodToCall;
404 }
405
406
407
408
409
410
411 public void setMethodToCall(String methodToCall) {
412 this.methodToCall = methodToCall;
413 }
414
415
416
417
418
419
420
421
422
423
424
425
426 @BeanTagAttribute(name = "actionLabel")
427 public String getActionLabel() {
428 return this.actionLabel;
429 }
430
431
432
433
434
435
436 public void setActionLabel(String actionLabel) {
437 this.actionLabel = actionLabel;
438 }
439
440
441
442
443
444
445
446
447
448
449
450
451
452 @BeanTagAttribute(name = "actionImage", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
453 public Image getActionImage() {
454 return this.actionImage;
455 }
456
457
458
459
460
461
462 public void setActionImage(Image actionImage) {
463 this.actionImage = actionImage;
464 }
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480 @BeanTagAttribute(name = "navigateToPageId")
481 public String getNavigateToPageId() {
482 return this.navigateToPageId;
483 }
484
485
486
487
488
489
490 public void setNavigateToPageId(String navigateToPageId) {
491 this.navigateToPageId = navigateToPageId;
492 actionParameters.put(UifParameters.NAVIGATE_TO_PAGE_ID, navigateToPageId);
493 this.methodToCall = UifConstants.MethodToCallNames.NAVIGATE;
494 }
495
496
497
498
499
500
501
502
503
504
505
506
507 @BeanTagAttribute(name = "actionEvent")
508 public String getActionEvent() {
509 return actionEvent;
510 }
511
512
513
514
515
516
517 public void setActionEvent(String actionEvent) {
518 this.actionEvent = actionEvent;
519 }
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540 @BeanTagAttribute(name = "additionalSubmitData", type = BeanTagAttribute.AttributeType.MAPVALUE)
541 public Map<String, String> getAdditionalSubmitData() {
542 return additionalSubmitData;
543 }
544
545
546
547
548
549
550 public void setAdditionalSubmitData(Map<String, String> additionalSubmitData) {
551 this.additionalSubmitData = additionalSubmitData;
552 }
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570 @BeanTagAttribute(name = "actionParameters", type = BeanTagAttribute.AttributeType.MAPVALUE)
571 public Map<String, String> getActionParameters() {
572 return this.actionParameters;
573 }
574
575
576
577
578
579
580 public void setActionParameters(Map<String, String> actionParameters) {
581 this.actionParameters = actionParameters;
582 }
583
584
585
586
587
588
589
590 public void addActionParameter(String parameterName, String parameterValue) {
591 if (actionParameters == null) {
592 this.actionParameters = new HashMap<String, String>();
593 }
594
595 this.actionParameters.put(parameterName, parameterValue);
596 }
597
598
599
600
601 public String getActionParameter(String parameterName) {
602 return this.actionParameters.get(parameterName);
603 }
604
605
606
607
608
609
610 public ActionSecurity getActionSecurity() {
611 return (ActionSecurity) super.getComponentSecurity();
612 }
613
614
615
616
617
618
619 @Override
620 public void setComponentSecurity(ComponentSecurity componentSecurity) {
621 if (!(componentSecurity instanceof ActionSecurity)) {
622 throw new RiceRuntimeException("Component security for Action should be instance of ActionSecurity");
623 }
624
625 super.setComponentSecurity(componentSecurity);
626 }
627
628 @Override
629 protected Class<? extends ComponentSecurity> getComponentSecurityClass() {
630 return ActionSecurity.class;
631 }
632
633
634
635
636 @BeanTagAttribute(name = "jumpToIdAfterSubmit")
637 public String getJumpToIdAfterSubmit() {
638 return this.jumpToIdAfterSubmit;
639 }
640
641
642
643
644
645
646
647
648
649
650
651
652 public void setJumpToIdAfterSubmit(String jumpToIdAfterSubmit) {
653 this.jumpToIdAfterSubmit = jumpToIdAfterSubmit;
654 }
655
656
657
658
659
660
661
662
663
664
665
666 @BeanTagAttribute(name = "jumpToNameAfterSubmit")
667 public String getJumpToNameAfterSubmit() {
668 return this.jumpToNameAfterSubmit;
669 }
670
671
672
673
674 public void setJumpToNameAfterSubmit(String jumpToNameAfterSubmit) {
675 this.jumpToNameAfterSubmit = jumpToNameAfterSubmit;
676 }
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695 @BeanTagAttribute(name = "focusOnIdAfterSubmit")
696 public String getFocusOnIdAfterSubmit() {
697 return this.focusOnIdAfterSubmit;
698 }
699
700
701
702
703 public void setFocusOnIdAfterSubmit(String focusOnIdAfterSubmit) {
704 this.focusOnIdAfterSubmit = focusOnIdAfterSubmit;
705 }
706
707
708
709
710
711
712 @BeanTagAttribute(name = "performClientSideValidation")
713 public boolean isPerformClientSideValidation() {
714 return this.performClientSideValidation;
715 }
716
717
718
719
720
721
722 public void setPerformClientSideValidation(boolean performClientSideValidation) {
723 this.performClientSideValidation = performClientSideValidation;
724 }
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740 @BeanTagAttribute(name = "actionScript")
741 public String getActionScript() {
742 return this.actionScript;
743 }
744
745
746
747
748 public void setActionScript(String actionScript) {
749 if (!StringUtils.endsWith(actionScript, ";")) {
750 actionScript = actionScript + ";";
751 }
752 this.actionScript = actionScript;
753 }
754
755
756
757
758 public void setPerformDirtyValidation(boolean performDirtyValidation) {
759 this.performDirtyValidation = performDirtyValidation;
760 }
761
762
763
764
765 @BeanTagAttribute(name = "performDirtyValidation")
766 public boolean isPerformDirtyValidation() {
767 return performDirtyValidation;
768 }
769
770
771
772
773
774
775 @BeanTagAttribute(name = "disabled")
776 public boolean isDisabled() {
777 return disabled;
778 }
779
780
781
782
783
784
785 public void setDisabled(boolean disabled) {
786 this.disabled = disabled;
787 }
788
789
790
791
792
793
794
795
796 @BeanTagAttribute(name = "disabledReason")
797 public String getDisabledReason() {
798 return disabledReason;
799 }
800
801
802
803
804
805
806 public void setDisabledReason(String disabledReason) {
807 this.disabledReason = disabledReason;
808 }
809
810 @BeanTagAttribute(name = "actionImagePlacement")
811 public String getActionImagePlacement() {
812 return actionImagePlacement;
813 }
814
815
816
817
818
819
820
821
822
823 public void setActionImagePlacement(String actionImagePlacement) {
824 this.actionImagePlacement = actionImagePlacement;
825 }
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848 @BeanTagAttribute(name = "preSubmitCall")
849 public String getPreSubmitCall() {
850 return preSubmitCall;
851 }
852
853
854
855
856
857
858 public void setPreSubmitCall(String preSubmitCall) {
859 this.preSubmitCall = preSubmitCall;
860 }
861
862
863
864
865
866
867
868 @BeanTagAttribute(name = "ajaxSubmit")
869 public boolean isAjaxSubmit() {
870 return ajaxSubmit;
871 }
872
873
874
875
876
877
878 public void setAjaxSubmit(boolean ajaxSubmit) {
879 this.ajaxSubmit = ajaxSubmit;
880 }
881
882
883
884
885
886
887
888
889
890
891
892
893 @BeanTagAttribute(name = "ajaxReturnType")
894 public String getAjaxReturnType() {
895 return this.ajaxReturnType;
896 }
897
898
899
900
901
902
903 public void setAjaxReturnType(String ajaxReturnType) {
904 this.ajaxReturnType = ajaxReturnType;
905 }
906
907
908
909
910
911
912 @BeanTagAttribute(name = "displayResponseInLightBox")
913 public boolean isDisplayResponseInLightBox() {
914 return StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey());
915 }
916
917
918
919
920
921
922 public void setDisplayResponseInLightBox(boolean displayResponseInLightBox) {
923 if (displayResponseInLightBox) {
924 this.ajaxReturnType = UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey();
925 }
926
927 else if (StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey())) {
928 this.ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATEPAGE.getKey();
929 }
930 }
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951 @BeanTagAttribute(name = "successCallback")
952 public String getSuccessCallback() {
953 return successCallback;
954 }
955
956
957
958
959
960
961 public void setSuccessCallback(String successCallback) {
962 this.successCallback = successCallback;
963 }
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985 @BeanTagAttribute(name = "errorCallback")
986 public String getErrorCallback() {
987 return errorCallback;
988 }
989
990
991
992
993
994
995 public void setErrorCallback(String errorCallback) {
996 this.errorCallback = errorCallback;
997 }
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009 @BeanTagAttribute(name = "refreshId")
1010 public String getRefreshId() {
1011 return refreshId;
1012 }
1013
1014
1015
1016
1017
1018
1019 public void setRefreshId(String refreshId) {
1020 this.refreshId = refreshId;
1021 }
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039 @BeanTagAttribute(name = "refreshPropertyName")
1040 public String getRefreshPropertyName() {
1041 return refreshPropertyName;
1042 }
1043
1044
1045
1046
1047
1048
1049 public void setRefreshPropertyName(String refreshPropertyName) {
1050 this.refreshPropertyName = refreshPropertyName;
1051 }
1052
1053
1054
1055
1056
1057
1058 @BeanTagAttribute(name = "loadingMessageText")
1059 public String getLoadingMessageText() {
1060 return loadingMessageText;
1061 }
1062
1063
1064
1065
1066
1067
1068 public void setLoadingMessageText(String loadingMessageText) {
1069 this.loadingMessageText = loadingMessageText;
1070 }
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087 @BeanTagAttribute(name = "disableBlocking")
1088 public boolean isDisableBlocking() {
1089 return disableBlocking;
1090 }
1091
1092
1093
1094
1095
1096
1097 public void setDisableBlocking(boolean disableBlocking) {
1098 this.disableBlocking = disableBlocking;
1099 }
1100
1101
1102
1103
1104 @Override
1105 public void completeValidation(ValidationTrace tracer) {
1106 tracer.addBean(this);
1107
1108
1109 if (getActionLabel() == null && getActionImage() == null) {
1110 String currentValues[] = {"actionLabel =" + getActionLabel(), "actionImage =" + getActionImage()};
1111 tracer.createError("ActionLabel and/or actionImage must be set", currentValues);
1112 }
1113
1114
1115 if (getJumpToIdAfterSubmit() != null && getJumpToNameAfterSubmit() != null) {
1116 String currentValues[] = {"jumpToIdAfterSubmit =" + getJumpToIdAfterSubmit(),
1117 "jumpToNameAfterSubmit =" + getJumpToNameAfterSubmit()};
1118 tracer.createWarning("Only 1 jumpTo property should be set", currentValues);
1119 }
1120 super.completeValidation(tracer.getCopy());
1121 }
1122
1123
1124
1125
1126
1127
1128 @BeanTagAttribute(name = "evaluateDisabledOnKeyUp")
1129 public boolean isEvaluateDisabledOnKeyUp() {
1130 return evaluateDisabledOnKeyUp;
1131 }
1132
1133
1134
1135
1136
1137
1138 public void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp) {
1139 this.evaluateDisabledOnKeyUp = evaluateDisabledOnKeyUp;
1140 }
1141
1142
1143
1144
1145
1146
1147 public String getDisabledConditionJs() {
1148 return disabledConditionJs;
1149 }
1150
1151
1152
1153
1154
1155
1156 public List<String> getDisabledConditionControlNames() {
1157 return disabledConditionControlNames;
1158 }
1159
1160
1161
1162
1163
1164
1165 @BeanTagAttribute(name = "disabledWhenChangedPropertyNames", type = BeanTagAttribute.AttributeType.LISTVALUE)
1166 public List<String> getDisabledWhenChangedPropertyNames() {
1167 return disabledWhenChangedPropertyNames;
1168 }
1169
1170
1171
1172
1173
1174
1175 public void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames) {
1176 this.disabledWhenChangedPropertyNames = disabledWhenChangedPropertyNames;
1177 }
1178
1179
1180
1181
1182
1183
1184 @BeanTagAttribute(name = "enabledWhenChangedPropertyNames", type = BeanTagAttribute.AttributeType.LISTVALUE)
1185 public List<String> getEnabledWhenChangedPropertyNames() {
1186 return enabledWhenChangedPropertyNames;
1187 }
1188
1189
1190
1191
1192
1193
1194 public void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames) {
1195 this.enabledWhenChangedPropertyNames = enabledWhenChangedPropertyNames;
1196 }
1197 }