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.container.DialogGroup;
31 import org.kuali.rice.krad.uif.container.Group;
32 import org.kuali.rice.krad.uif.field.DataField;
33 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
34 import org.kuali.rice.krad.uif.util.ComponentFactory;
35 import org.kuali.rice.krad.uif.util.LifecycleElement;
36 import org.kuali.rice.krad.uif.util.ScriptUtils;
37 import org.kuali.rice.krad.uif.util.UrlInfo;
38 import org.kuali.rice.krad.uif.view.ExpressionEvaluator;
39 import org.kuali.rice.krad.uif.view.FormView;
40 import org.kuali.rice.krad.uif.view.View;
41 import org.kuali.rice.krad.util.KRADUtils;
42
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.List;
46 import java.util.Map;
47
48
49
50
51
52
53 @BeanTags({@BeanTag(name = "action", parent = "Uif-Action"),
54 @BeanTag(name = "actionImage", parent = "Uif-ActionImage"),
55 @BeanTag(name = "button", parent = "Uif-PrimaryActionButton"),
56 @BeanTag(name = "secondaryButton", parent = "Uif-SecondaryActionButton"),
57 @BeanTag(name = "buttonLarge", parent = "Uif-PrimaryActionButton-Large"),
58 @BeanTag(name = "secondaryButtonLarge", parent = "Uif-SecondaryActionButton-Large"),
59 @BeanTag(name = "buttonSmall", parent = "Uif-PrimaryActionButton-Small"),
60 @BeanTag(name = "secondaryButtonSmall", parent = "Uif-SecondaryActionButton-Small"),
61 @BeanTag(name = "buttonMini", parent = "Uif-PrimaryActionButton-Mini"),
62 @BeanTag(name = "secondaryButtonMini", parent = "Uif-SecondaryActionButton-Mini"),
63 @BeanTag(name = "actionLink", parent = "Uif-ActionLink"),
64 @BeanTag(name = "navigationActionLink", parent = "Uif-NavigationActionLink"),
65 @BeanTag(name = "navigationButton", parent = "Uif-NavigationActionButton"),
66 @BeanTag(name = "secondaryNavigationActionButton", parent = "Uif-SecondaryNavigationActionButton")})
67 public class Action extends ContentElementBase {
68 private static final long serialVersionUID = 1025672792657238829L;
69
70 private String methodToCall;
71 private String actionEvent;
72 private String navigateToPageId;
73
74 private String actionScript;
75 private UrlInfo actionUrl;
76
77 private String actionLabel;
78 private boolean renderInnerTextSpan;
79
80 private Image actionImage;
81 private String actionImagePlacement;
82
83 private String iconClass;
84 private String actionIconPlacement;
85
86 private String jumpToIdAfterSubmit;
87 private String jumpToNameAfterSubmit;
88 private String focusOnIdAfterSubmit;
89
90 private boolean performClientSideValidation;
91 private boolean performDirtyValidation;
92 private boolean clearDirtyOnAction;
93 private boolean dirtyOnAction;
94
95 private String preSubmitCall;
96 private String confirmationPromptText;
97 private DialogGroup confirmationDialog;
98
99 private String dialogDismissOption;
100 private String dialogResponse;
101
102 private boolean ajaxSubmit;
103 private String ajaxReturnType;
104 private String refreshId;
105 private String refreshPropertyName;
106
107 private String successCallback;
108 private String errorCallback;
109
110 private String loadingMessageText;
111 private boolean disableBlocking;
112
113 private Map<String, String> additionalSubmitData;
114 private Map<String, String> actionParameters;
115
116 private boolean evaluateDisabledOnKeyUp;
117
118 private boolean defaultEnterKeyAction;
119
120 private boolean disabled;
121 private String disabledReason;
122 private String disabledExpression;
123 private String disabledConditionJs;
124 private List<String> disabledConditionControlNames;
125
126 private List<String> disabledWhenChangedPropertyNames;
127 private List<String> enabledWhenChangedPropertyNames;
128
129
130
131
132 public Action() {
133 super();
134
135 actionImagePlacement = UifConstants.Position.LEFT.name();
136 actionIconPlacement = UifConstants.Position.LEFT.name();
137
138 ajaxSubmit = true;
139
140 successCallback = "";
141 errorCallback = "";
142 preSubmitCall = "";
143
144 additionalSubmitData = new HashMap<String, String>();
145 actionParameters = new HashMap<String, String>();
146
147 disabled = false;
148 disabledWhenChangedPropertyNames = new ArrayList<String>();
149 enabledWhenChangedPropertyNames = new ArrayList<String>();
150 }
151
152
153
154
155
156
157
158 public void performApplyModel(Object model, LifecycleElement parent) {
159 super.performApplyModel(model, parent);
160
161 disabledExpression = this.getPropertyExpression("disabled");
162 if (disabledExpression != null) {
163 ExpressionEvaluator expressionEvaluator = ViewLifecycle.getExpressionEvaluator();
164
165 disabledExpression = expressionEvaluator.replaceBindingPrefixes(ViewLifecycle.getView(), this,
166 disabledExpression);
167 disabled = (Boolean) expressionEvaluator.evaluateExpression(this.getContext(), disabledExpression);
168 }
169
170 if (actionUrl != null) {
171 ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(actionUrl, false);
172 ViewLifecycle.getExpressionEvaluator().evaluateExpressionsOnConfigurable(ViewLifecycle.getView(),
173 actionUrl, this.getContext());
174 }
175
176 if (StringUtils.isNotBlank(confirmationPromptText) && (confirmationDialog != null) && StringUtils.isBlank(
177 confirmationDialog.getPromptText())) {
178 confirmationDialog.setPromptText(confirmationPromptText);
179 }
180
181 addConfirmDialogToView();
182 }
183
184
185
186
187
188 protected void addConfirmDialogToView() {
189 if (StringUtils.isBlank(confirmationPromptText) || (confirmationDialog != null)) {
190 return;
191 }
192
193 boolean containsYesNoDialog = false;
194
195 List<Group> viewDialogs = ViewLifecycle.getView().getDialogs();
196 if (viewDialogs == null) {
197 viewDialogs = new ArrayList<Group>();
198 } else {
199 for (Group dialogGroup : viewDialogs) {
200 if (StringUtils.equals(ComponentFactory.YES_NO_DIALOG, dialogGroup.getId())) {
201 containsYesNoDialog = true;
202 }
203 }
204 }
205
206 if (!containsYesNoDialog) {
207 Group confirmDialog = ComponentFactory.getYesNoDialog();
208 confirmDialog.setId(ComponentFactory.YES_NO_DIALOG);
209
210 viewDialogs.add(confirmDialog);
211 }
212 }
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228 @Override
229 public void performFinalize(Object model, LifecycleElement parent) {
230 super.performFinalize(model, parent);
231
232 View view = ViewLifecycle.getView();
233 ExpressionEvaluator expressionEvaluator = ViewLifecycle.getExpressionEvaluator();
234
235 if (StringUtils.isNotEmpty(disabledExpression)
236 && !disabledExpression.equalsIgnoreCase("true")
237 && !disabledExpression.equalsIgnoreCase("false")) {
238 disabledConditionControlNames = new ArrayList<String>();
239 disabledConditionJs = ViewLifecycle.getExpressionEvaluator().parseExpression(disabledExpression,
240 disabledConditionControlNames, this.getContext());
241 }
242
243 List<String> adjustedDisablePropertyNames = new ArrayList<String>();
244 for (String propertyName : disabledWhenChangedPropertyNames) {
245 adjustedDisablePropertyNames.add(expressionEvaluator.replaceBindingPrefixes(view, this, propertyName));
246 }
247 disabledWhenChangedPropertyNames = adjustedDisablePropertyNames;
248
249 List<String> adjustedEnablePropertyNames = new ArrayList<String>();
250 for (String propertyName : enabledWhenChangedPropertyNames) {
251 adjustedEnablePropertyNames.add(expressionEvaluator.replaceBindingPrefixes(view, this, propertyName));
252 }
253 enabledWhenChangedPropertyNames = adjustedEnablePropertyNames;
254
255
256 if (actionImage != null && StringUtils.isNotBlank(actionImagePlacement) && StringUtils.isNotBlank(actionLabel)) {
257 actionImage.setAltText("");
258 }
259
260
261 if (StringUtils.isNotBlank(iconClass) && (UifConstants.ICON_ONLY_PLACEMENT.equals(actionIconPlacement)
262 || StringUtils.isBlank(actionLabel))) {
263 getCssClasses().add(iconClass);
264
265
266 actionIconPlacement = UifConstants.ICON_ONLY_PLACEMENT;
267 }
268
269 if (!actionParameters.containsKey(UifConstants.UrlParams.ACTION_EVENT) && StringUtils.isNotBlank(actionEvent)) {
270 actionParameters.put(UifConstants.UrlParams.ACTION_EVENT, actionEvent);
271 }
272
273 if (StringUtils.isNotBlank(navigateToPageId)) {
274 actionParameters.put(UifParameters.NAVIGATE_TO_PAGE_ID, navigateToPageId);
275 if (StringUtils.isBlank(methodToCall)) {
276 this.methodToCall = UifConstants.MethodToCallNames.NAVIGATE;
277 }
278 }
279
280 if (!actionParameters.containsKey(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME) && StringUtils
281 .isNotBlank(methodToCall)) {
282 actionParameters.put(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME, methodToCall);
283 }
284
285 setupRefreshAction(view);
286
287
288 if (view instanceof FormView) {
289 performDirtyValidation = performDirtyValidation && ((FormView) view).isApplyDirtyCheck();
290 }
291
292 if (StringUtils.isBlank(getActionScript()) && (actionUrl != null) && actionUrl.isFullyConfigured()) {
293 String actionScript = ScriptUtils.buildFunctionCall(UifConstants.JsFunctions.REDIRECT, actionUrl.getHref());
294 setActionScript(actionScript);
295 }
296
297
298 if (StringUtils.isNotBlank(methodToCall)) {
299 ViewLifecycle.getViewPostMetadata().addAvailableMethodToCall(methodToCall);
300 }
301
302
303 if (isRender()) {
304 for (String additionalSubmitPath : additionalSubmitData.keySet()) {
305 ViewLifecycle.getViewPostMetadata().addAccessibleBindingPath(additionalSubmitPath);
306 }
307
308 if (StringUtils.isNotBlank(methodToCall)) {
309 ViewLifecycle.getViewPostMetadata().addAccessibleMethodToCall(methodToCall);
310 }
311 }
312
313 buildActionData(view, model, parent);
314 }
315
316
317
318
319
320
321
322 protected void setupRefreshAction(View view) {
323
324
325 if (StringUtils.isNotBlank(refreshPropertyName) || StringUtils.isNotBlank(refreshId)) {
326 ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATECOMPONENT.getKey();
327 }
328
329
330
331 Component refreshComponent = null;
332 if (StringUtils.isNotBlank(refreshPropertyName)) {
333
334 if (refreshPropertyName.startsWith(UifConstants.NO_BIND_ADJUST_PREFIX)) {
335 refreshPropertyName = StringUtils.removeStart(refreshPropertyName, UifConstants.NO_BIND_ADJUST_PREFIX);
336 } else if (StringUtils.isNotBlank(view.getDefaultBindingObjectPath())) {
337 refreshPropertyName = view.getDefaultBindingObjectPath() + "." + refreshPropertyName;
338 }
339
340 DataField dataField = view.getViewIndex().getDataFieldByPath(refreshPropertyName);
341 if (dataField != null) {
342 refreshComponent = dataField;
343 refreshId = refreshComponent.getId();
344 }
345 } else if (StringUtils.isNotBlank(refreshId)) {
346 Component component = view.getViewIndex().getComponentById(refreshId);
347 if (component != null) {
348 refreshComponent = component;
349 }
350 }
351
352 if (refreshComponent != null) {
353 refreshComponent.setRefreshedByAction(true);
354 }
355 }
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370 protected void buildActionData(View view, Object model, LifecycleElement parent) {
371 HashMap<String, String> actionDataAttributes = new HashMap<String, String>();
372
373 Map<String, String> dataDefaults =
374 (Map<String, String>) (KRADServiceLocatorWeb.getDataDictionaryService().getDictionaryBean(
375 UifConstants.ACTION_DEFAULTS_MAP_ID));
376
377
378 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.AJAX_SUBMIT,
379 Boolean.toString(ajaxSubmit));
380 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
381 UifConstants.ActionDataAttributes.SUCCESS_CALLBACK, this.successCallback);
382 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.ERROR_CALLBACK,
383 this.errorCallback);
384 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
385 UifConstants.ActionDataAttributes.PRE_SUBMIT_CALL, this.preSubmitCall);
386 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
387 UifConstants.ActionDataAttributes.LOADING_MESSAGE, this.loadingMessageText);
388 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
389 UifConstants.ActionDataAttributes.DISABLE_BLOCKING, Boolean.toString(this.disableBlocking));
390 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
391 UifConstants.ActionDataAttributes.AJAX_RETURN_TYPE, this.ajaxReturnType);
392 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.REFRESH_ID,
393 this.refreshId);
394 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.VALIDATE,
395 Boolean.toString(this.performClientSideValidation));
396 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
397 UifConstants.ActionDataAttributes.DIRTY_ON_ACTION, Boolean.toString(this.dirtyOnAction));
398 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.CLEAR_DIRTY,
399 Boolean.toString(this.clearDirtyOnAction));
400 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
401 UifConstants.ActionDataAttributes.PERFORM_DIRTY_VALIDATION, Boolean.toString(
402 this.performDirtyValidation));
403
404 if (confirmationDialog != null) {
405 addDataAttribute(UifConstants.ActionDataAttributes.CONFIRM_DIALOG_ID, confirmationDialog.getId());
406 } else if (StringUtils.isNotBlank(confirmationPromptText)) {
407 addDataAttribute(UifConstants.ActionDataAttributes.CONFIRM_PROMPT_TEXT, confirmationPromptText);
408 }
409
410 if (StringUtils.isNotBlank(dialogDismissOption)) {
411 addDataAttribute(UifConstants.DataAttributes.DISMISS_DIALOG_OPTION, dialogDismissOption);
412 }
413
414 if (StringUtils.isNotBlank(dialogResponse)) {
415 addDataAttribute(UifConstants.DataAttributes.DISMISS_RESPONSE, dialogResponse);
416 }
417
418
419 Map<String, String> submitData = new HashMap<String, String>();
420 for (String key : actionParameters.keySet()) {
421 String parameterPath = key;
422 if (!key.equals(UifConstants.CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME)) {
423 parameterPath = UifPropertyPaths.ACTION_PARAMETERS + "[" + key + "]";
424 }
425 submitData.put(parameterPath, actionParameters.get(key));
426 }
427
428 for (String key : additionalSubmitData.keySet()) {
429 submitData.put(key, additionalSubmitData.get(key));
430 }
431
432
433 if (focusOnIdAfterSubmit.equalsIgnoreCase(UifConstants.Order.NEXT_INPUT.toString())) {
434 focusOnIdAfterSubmit = UifConstants.Order.NEXT_INPUT.toString() + ":" + this.getId();
435 }
436
437 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.FOCUS_ID,
438 focusOnIdAfterSubmit);
439
440 if (StringUtils.isNotBlank(jumpToIdAfterSubmit)) {
441 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.ActionDataAttributes.JUMP_TO_ID,
442 jumpToIdAfterSubmit);
443 } else if (StringUtils.isNotBlank(jumpToNameAfterSubmit)) {
444 addActionDataSettingsValue(actionDataAttributes, dataDefaults,
445 UifConstants.ActionDataAttributes.JUMP_TO_NAME, jumpToNameAfterSubmit);
446 }
447
448 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.DataAttributes.SUBMIT_DATA,
449 ScriptUtils.toJSON(submitData));
450
451
452 String onClickScript = this.getOnClickScript();
453 if (StringUtils.isNotBlank(actionScript)) {
454 onClickScript = ScriptUtils.appendScript(onClickScript, actionScript);
455 } else {
456 onClickScript = ScriptUtils.appendScript(onClickScript, "actionInvokeHandler(this);");
457 }
458
459
460 if (disabled) {
461 this.addStyleClass("disabled");
462 this.setSkipInTabOrder(true);
463 }
464
465
466 addActionDataSettingsValue(actionDataAttributes, dataDefaults, UifConstants.DataAttributes.ONCLICK,
467 KRADUtils.convertToHTMLAttributeSafeString(onClickScript));
468
469 if (!actionDataAttributes.isEmpty()) {
470 this.getDataAttributes().putAll(actionDataAttributes);
471 }
472
473 this.addDataAttribute(UifConstants.DataAttributes.ROLE, UifConstants.RoleTypes.ACTION);
474
475
476 if (this.isDefaultEnterKeyAction()) {
477 this.addDataAttribute(UifConstants.DataAttributes.DEFAULT_ENTER_KEY_ACTION,
478 Boolean.toString(this.isDefaultEnterKeyAction()));
479 }
480 }
481
482
483
484
485
486
487
488
489
490
491
492 protected void addActionDataSettingsValue(Map<String, String> valueMap, Map<String, String> defaults, String key,
493 String value) {
494 if (StringUtils.isBlank(value)) {
495 return;
496 }
497
498 String defaultValue = defaults.get(key);
499 if (defaultValue == null || !value.equals(defaultValue)) {
500 valueMap.put(key, value);
501 }
502 }
503
504
505
506
507
508
509
510
511
512
513
514
515
516 @BeanTagAttribute
517 public String getMethodToCall() {
518 return this.methodToCall;
519 }
520
521
522
523
524
525
526 public void setMethodToCall(String methodToCall) {
527 this.methodToCall = methodToCall;
528 }
529
530
531
532
533
534
535
536
537
538
539
540
541 @BeanTagAttribute
542 public String getActionLabel() {
543 return this.actionLabel;
544 }
545
546
547
548
549
550
551 public void setActionLabel(String actionLabel) {
552 this.actionLabel = actionLabel;
553 }
554
555
556
557
558
559
560 @BeanTagAttribute
561 public boolean isRenderInnerTextSpan() {
562 return renderInnerTextSpan;
563 }
564
565
566
567
568
569
570 public void setRenderInnerTextSpan(boolean renderInnerTextSpan) {
571 this.renderInnerTextSpan = renderInnerTextSpan;
572 }
573
574
575
576
577
578
579
580
581
582
583
584
585
586 @BeanTagAttribute
587 public Image getActionImage() {
588 return this.actionImage;
589 }
590
591
592
593
594
595
596 public void setActionImage(Image actionImage) {
597 this.actionImage = actionImage;
598 }
599
600
601
602
603
604
605 @BeanTagAttribute
606 public String getIconClass() {
607 return iconClass;
608 }
609
610
611
612
613
614
615 public void setIconClass(String iconClass) {
616 this.iconClass = iconClass;
617 }
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633 @BeanTagAttribute
634 public String getNavigateToPageId() {
635 return this.navigateToPageId;
636 }
637
638
639
640
641
642
643 public void setNavigateToPageId(String navigateToPageId) {
644 this.navigateToPageId = navigateToPageId;
645 }
646
647
648
649
650
651
652
653
654
655
656
657
658 @BeanTagAttribute
659 public String getActionEvent() {
660 return actionEvent;
661 }
662
663
664
665
666
667
668 public void setActionEvent(String actionEvent) {
669 this.actionEvent = actionEvent;
670 }
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691 @BeanTagAttribute
692 public Map<String, String> getAdditionalSubmitData() {
693 return additionalSubmitData;
694 }
695
696
697
698
699
700
701 public void setAdditionalSubmitData(Map<String, String> additionalSubmitData) {
702 this.additionalSubmitData = additionalSubmitData;
703 }
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721 @BeanTagAttribute
722 public Map<String, String> getActionParameters() {
723 return this.actionParameters;
724 }
725
726
727
728
729
730
731 public void setActionParameters(Map<String, String> actionParameters) {
732 this.actionParameters = actionParameters;
733 }
734
735
736
737
738
739
740
741 public void addActionParameter(String parameterName, String parameterValue) {
742 if (actionParameters == null) {
743 this.actionParameters = new HashMap<String, String>();
744 }
745
746 this.actionParameters.put(parameterName, parameterValue);
747 }
748
749
750
751
752
753
754
755 public String getActionParameter(String parameterName) {
756 return this.actionParameters.get(parameterName);
757 }
758
759
760
761
762
763
764 public ActionSecurity getActionSecurity() {
765 return (ActionSecurity) super.getComponentSecurity();
766 }
767
768
769
770
771
772
773 @Override
774 public void setComponentSecurity(ComponentSecurity componentSecurity) {
775 if ((componentSecurity != null) && !(componentSecurity instanceof ActionSecurity)) {
776 throw new RiceRuntimeException("Component security for Action should be instance of ActionSecurity");
777 }
778
779 super.setComponentSecurity(componentSecurity);
780 }
781
782
783
784
785 @Override
786 protected void initializeComponentSecurity() {
787 if (getComponentSecurity() == null) {
788 setComponentSecurity(KRADUtils.createNewObjectFromClass(ActionSecurity.class));
789 }
790 }
791
792
793
794
795
796
797 @BeanTagAttribute
798 public boolean isPerformActionAuthz() {
799 initializeComponentSecurity();
800
801 return getActionSecurity().isPerformActionAuthz();
802 }
803
804
805
806
807
808
809 public void setPerformActionAuthz(boolean performActionAuthz) {
810 initializeComponentSecurity();
811
812 getActionSecurity().setPerformActionAuthz(performActionAuthz);
813 }
814
815
816
817
818
819
820 @BeanTagAttribute
821 public boolean isPerformLineActionAuthz() {
822 initializeComponentSecurity();
823
824 return getActionSecurity().isPerformLineActionAuthz();
825 }
826
827
828
829
830
831
832 public void setPerformLineActionAuthz(boolean performLineActionAuthz) {
833 initializeComponentSecurity();
834
835 getActionSecurity().setPerformLineActionAuthz(performLineActionAuthz);
836 }
837
838
839
840
841
842
843 @BeanTagAttribute
844 public String getJumpToIdAfterSubmit() {
845 return this.jumpToIdAfterSubmit;
846 }
847
848
849
850
851
852
853
854
855
856
857
858
859 public void setJumpToIdAfterSubmit(String jumpToIdAfterSubmit) {
860 this.jumpToIdAfterSubmit = jumpToIdAfterSubmit;
861 }
862
863
864
865
866
867
868
869
870
871
872
873 @BeanTagAttribute
874 public String getJumpToNameAfterSubmit() {
875 return this.jumpToNameAfterSubmit;
876 }
877
878
879
880
881
882
883 public void setJumpToNameAfterSubmit(String jumpToNameAfterSubmit) {
884 this.jumpToNameAfterSubmit = jumpToNameAfterSubmit;
885 }
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904 @BeanTagAttribute
905 public String getFocusOnIdAfterSubmit() {
906 return this.focusOnIdAfterSubmit;
907 }
908
909
910
911
912
913
914 public void setFocusOnIdAfterSubmit(String focusOnIdAfterSubmit) {
915 this.focusOnIdAfterSubmit = focusOnIdAfterSubmit;
916 }
917
918
919
920
921
922
923 @BeanTagAttribute
924 public boolean isPerformClientSideValidation() {
925 return this.performClientSideValidation;
926 }
927
928
929
930
931
932
933 public void setPerformClientSideValidation(boolean performClientSideValidation) {
934 this.performClientSideValidation = performClientSideValidation;
935 }
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951 @BeanTagAttribute
952 public String getActionScript() {
953 return this.actionScript;
954 }
955
956
957
958
959
960
961 public void setActionScript(String actionScript) {
962 if (StringUtils.isNotBlank(actionScript) && !StringUtils.endsWith(actionScript, ";")) {
963 actionScript = actionScript + ";";
964 }
965
966 this.actionScript = actionScript;
967 }
968
969
970
971
972
973
974
975
976
977
978
979 @BeanTagAttribute
980 public UrlInfo getActionUrl() {
981 return actionUrl;
982 }
983
984
985
986
987
988
989 public void setActionUrl(UrlInfo actionUrl) {
990 this.actionUrl = actionUrl;
991 }
992
993
994
995
996
997
998 public void setPerformDirtyValidation(boolean performDirtyValidation) {
999 this.performDirtyValidation = performDirtyValidation;
1000 }
1001
1002
1003
1004
1005
1006
1007 @BeanTagAttribute
1008 public boolean isPerformDirtyValidation() {
1009 return performDirtyValidation;
1010 }
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020 @BeanTagAttribute
1021 public boolean isClearDirtyOnAction() {
1022 return clearDirtyOnAction;
1023 }
1024
1025
1026
1027
1028
1029
1030 public void setClearDirtyOnAction(boolean clearDirtyOnAction) {
1031 this.clearDirtyOnAction = clearDirtyOnAction;
1032 }
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043 @BeanTagAttribute
1044 public boolean isDirtyOnAction() {
1045 return dirtyOnAction;
1046 }
1047
1048
1049
1050
1051
1052
1053 public void setDirtyOnAction(boolean dirtyOnAction) {
1054 this.dirtyOnAction = dirtyOnAction;
1055 }
1056
1057
1058
1059
1060
1061
1062 @BeanTagAttribute
1063 public boolean isDisabled() {
1064 return disabled;
1065 }
1066
1067
1068
1069
1070
1071
1072 public void setDisabled(boolean disabled) {
1073 this.disabled = disabled;
1074 }
1075
1076
1077
1078
1079
1080
1081
1082
1083 @BeanTagAttribute
1084 public String getDisabledReason() {
1085 return disabledReason;
1086 }
1087
1088
1089
1090
1091
1092
1093 public void setDisabledReason(String disabledReason) {
1094 this.disabledReason = disabledReason;
1095 }
1096
1097
1098
1099
1100
1101
1102 @BeanTagAttribute
1103 public String getActionImagePlacement() {
1104 return actionImagePlacement;
1105 }
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115 public void setActionImagePlacement(String actionImagePlacement) {
1116 this.actionImagePlacement = actionImagePlacement;
1117 }
1118
1119
1120
1121
1122
1123
1124 @BeanTagAttribute
1125 public String getActionIconPlacement() {
1126 return actionIconPlacement;
1127 }
1128
1129
1130
1131
1132
1133
1134 public void setActionIconPlacement(String actionIconPlacement) {
1135 this.actionIconPlacement = actionIconPlacement;
1136 }
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159 @BeanTagAttribute
1160 public String getPreSubmitCall() {
1161 return preSubmitCall;
1162 }
1163
1164
1165
1166
1167
1168
1169 public void setPreSubmitCall(String preSubmitCall) {
1170 this.preSubmitCall = preSubmitCall;
1171 }
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182 public String getConfirmationPromptText() {
1183 return confirmationPromptText;
1184 }
1185
1186
1187
1188
1189 public void setConfirmationPromptText(String confirmationPromptText) {
1190 this.confirmationPromptText = confirmationPromptText;
1191 }
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201 public DialogGroup getConfirmationDialog() {
1202 return confirmationDialog;
1203 }
1204
1205
1206
1207
1208 public void setConfirmationDialog(DialogGroup confirmationDialog) {
1209 this.confirmationDialog = confirmationDialog;
1210 }
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228 public String getDialogDismissOption() {
1229 return dialogDismissOption;
1230 }
1231
1232
1233
1234
1235 public void setDialogDismissOption(String dialogDismissOption) {
1236 this.dialogDismissOption = dialogDismissOption;
1237 }
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251 public String getDialogResponse() {
1252 return dialogResponse;
1253 }
1254
1255
1256
1257
1258 public void setDialogResponse(String dialogResponse) {
1259 this.dialogResponse = dialogResponse;
1260 }
1261
1262
1263
1264
1265
1266
1267
1268 @BeanTagAttribute
1269 public boolean isAjaxSubmit() {
1270 return ajaxSubmit;
1271 }
1272
1273
1274
1275
1276
1277
1278 public void setAjaxSubmit(boolean ajaxSubmit) {
1279 this.ajaxSubmit = ajaxSubmit;
1280 }
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293 @BeanTagAttribute
1294 public String getAjaxReturnType() {
1295 return this.ajaxReturnType;
1296 }
1297
1298
1299
1300
1301
1302
1303 public void setAjaxReturnType(String ajaxReturnType) {
1304 this.ajaxReturnType = ajaxReturnType;
1305 }
1306
1307
1308
1309
1310
1311
1312 @BeanTagAttribute
1313 public boolean isDisplayResponseInLightBox() {
1314 return StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey());
1315 }
1316
1317
1318
1319
1320
1321
1322 public void setDisplayResponseInLightBox(boolean displayResponseInLightBox) {
1323 if (displayResponseInLightBox) {
1324 this.ajaxReturnType = UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey();
1325 }
1326
1327 else if (StringUtils.equals(this.ajaxReturnType, UifConstants.AjaxReturnTypes.DISPLAYLIGHTBOX.getKey())) {
1328 this.ajaxReturnType = UifConstants.AjaxReturnTypes.UPDATEPAGE.getKey();
1329 }
1330 }
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351 @BeanTagAttribute
1352 public String getSuccessCallback() {
1353 return successCallback;
1354 }
1355
1356
1357
1358
1359
1360
1361 public void setSuccessCallback(String successCallback) {
1362 this.successCallback = successCallback;
1363 }
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385 @BeanTagAttribute
1386 public String getErrorCallback() {
1387 return errorCallback;
1388 }
1389
1390
1391
1392
1393
1394
1395 public void setErrorCallback(String errorCallback) {
1396 this.errorCallback = errorCallback;
1397 }
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409 @BeanTagAttribute
1410 public String getRefreshId() {
1411 return refreshId;
1412 }
1413
1414
1415
1416
1417
1418
1419 public void setRefreshId(String refreshId) {
1420 this.refreshId = refreshId;
1421 }
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439 @BeanTagAttribute
1440 public String getRefreshPropertyName() {
1441 return refreshPropertyName;
1442 }
1443
1444
1445
1446
1447
1448
1449 public void setRefreshPropertyName(String refreshPropertyName) {
1450 this.refreshPropertyName = refreshPropertyName;
1451 }
1452
1453
1454
1455
1456
1457
1458 @BeanTagAttribute
1459 public String getLoadingMessageText() {
1460 return loadingMessageText;
1461 }
1462
1463
1464
1465
1466
1467
1468 public void setLoadingMessageText(String loadingMessageText) {
1469 this.loadingMessageText = loadingMessageText;
1470 }
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487 @BeanTagAttribute
1488 public boolean isDisableBlocking() {
1489 return disableBlocking;
1490 }
1491
1492
1493
1494
1495
1496
1497 public void setDisableBlocking(boolean disableBlocking) {
1498 this.disableBlocking = disableBlocking;
1499 }
1500
1501
1502
1503
1504
1505
1506 @BeanTagAttribute
1507 public boolean isEvaluateDisabledOnKeyUp() {
1508 return evaluateDisabledOnKeyUp;
1509 }
1510
1511
1512
1513
1514
1515
1516 public void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp) {
1517 this.evaluateDisabledOnKeyUp = evaluateDisabledOnKeyUp;
1518 }
1519
1520
1521
1522
1523
1524
1525 @BeanTagAttribute(name = "defaultEnterKeyAction")
1526 public boolean isDefaultEnterKeyAction() {
1527 return this.defaultEnterKeyAction;
1528 }
1529
1530
1531
1532
1533 public void setDefaultEnterKeyAction(boolean defaultEnterKeyAction) {
1534 this.defaultEnterKeyAction = defaultEnterKeyAction;
1535 }
1536
1537
1538
1539
1540
1541
1542 public String getDisabledConditionJs() {
1543 return disabledConditionJs;
1544 }
1545
1546
1547
1548
1549
1550
1551 protected void setDisabledConditionJs(String disabledConditionJs) {
1552 this.disabledConditionJs = disabledConditionJs;
1553 }
1554
1555
1556
1557
1558
1559
1560 public List<String> getDisabledConditionControlNames() {
1561 return disabledConditionControlNames;
1562 }
1563
1564
1565
1566
1567
1568
1569 public void setDisabledConditionControlNames(List<String> disabledConditionControlNames) {
1570 this.disabledConditionControlNames = disabledConditionControlNames;
1571 }
1572
1573
1574
1575
1576
1577
1578 @BeanTagAttribute
1579 public List<String> getDisabledWhenChangedPropertyNames() {
1580 return disabledWhenChangedPropertyNames;
1581 }
1582
1583
1584
1585
1586
1587
1588 public void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames) {
1589 this.disabledWhenChangedPropertyNames = disabledWhenChangedPropertyNames;
1590 }
1591
1592
1593
1594
1595
1596
1597 @BeanTagAttribute
1598 public List<String> getEnabledWhenChangedPropertyNames() {
1599 return enabledWhenChangedPropertyNames;
1600 }
1601
1602
1603
1604
1605
1606
1607 public void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames) {
1608 this.enabledWhenChangedPropertyNames = enabledWhenChangedPropertyNames;
1609 }
1610
1611
1612
1613
1614
1615
1616 protected void setDisabledExpression(String disabledExpression) {
1617 this.disabledExpression = disabledExpression;
1618 }
1619
1620
1621
1622
1623 @Override
1624 public void completeValidation(ValidationTrace tracer) {
1625 tracer.addBean(this);
1626
1627
1628 if (getJumpToIdAfterSubmit() != null && getJumpToNameAfterSubmit() != null) {
1629 String currentValues[] = {"jumpToIdAfterSubmit =" + getJumpToIdAfterSubmit(),
1630 "jumpToNameAfterSubmit =" + getJumpToNameAfterSubmit()};
1631 tracer.createWarning("Only 1 jumpTo property should be set", currentValues);
1632 }
1633 super.completeValidation(tracer.getCopy());
1634 }
1635 }