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.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.uif.component.Component;
21 import org.kuali.rice.krad.uif.util.ScriptUtils;
22 import org.kuali.rice.krad.uif.view.View;
23
24
25
26
27 @BeanTag(name = "fieldValidationMessages", parent = "Uif-FieldValidationMessages")
28 public class FieldValidationMessages extends ValidationMessages{
29
30 private boolean useTooltip;
31
32 @Override
33
34
35
36
37
38
39 public void generateMessages(boolean reset, View view, Object model, Component parent) {
40 super.generateMessages(reset, view, model, parent);
41 boolean hasMessages = false;
42 if(!this.getErrors().isEmpty() || !this.getWarnings().isEmpty() || !this.getInfos().isEmpty()){
43 hasMessages = true;
44 }
45 parent.addDataAttribute("validationMessages", "{"
46 + "displayMessages:" + this.isDisplayMessages() + ","
47 + "useTooltip:"+ useTooltip + ","
48 + "messagingEnabled:"+ this.isDisplayMessages() + ","
49 + "hasOwnMessages:"+ hasMessages + ","
50 + "serverErrors:" + ScriptUtils.convertStringListToJsArray(ScriptUtils.escapeHtml(this.getErrors())) + ","
51 + "serverWarnings:" + ScriptUtils.convertStringListToJsArray(ScriptUtils.escapeHtml(this.getWarnings())) + ","
52 + "serverInfo:" + ScriptUtils.convertStringListToJsArray(ScriptUtils.escapeHtml(this.getInfos()))
53 + "}");
54 }
55
56
57
58
59
60
61
62
63 @BeanTagAttribute(name="useTooltip")
64 public boolean isUseTooltip() {
65 return useTooltip;
66 }
67
68
69
70
71
72
73 public void setUseTooltip(boolean useTooltip) {
74 this.useTooltip = useTooltip;
75 }
76
77 }