|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.datadictionary.DictionaryBeanBase org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase org.kuali.rice.krad.uif.element.ValidationMessages
public class ValidationMessages
Field that displays error, warning, and info messages for the keys that are matched. By default, an ValidationMessages will match on id and bindingPath (if this ValidationMessages is for an InputField), but can be set to match on additionalKeys and nested components keys (of the its parentComponent). In addition, there are a variety of options which can be toggled to effect the display of these messages during both client and server side validation display. See documentation on each get method for more details on the effect of each option.
Field Summary |
---|
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
componentCode, namespaceCode |
Constructor Summary | |
---|---|
ValidationMessages()
|
Method Summary | |
---|---|
protected void |
addNestedGroupKeys(Collection<String> keyList,
Component component)
Adds all group keys of this component (starting from this component itself) by calling getKeys on each of its nested group's ValidationMessages and adding them to the list. |
protected void |
addValidationDataSettingsValue(Map<String,Object> valueMap,
Map<String,String> defaults,
String key,
Object value)
Adds the value passed to the valueMap with the key specified, if the value does not match the value which already exists in defaults (to avoid having to write out extra data that can later be derived from the defaults in the js) |
void |
generateMessages(View view,
Object model,
Component parent)
Generates the messages based on the content in the messageMap |
List<String> |
getAdditionalKeysToMatch()
AdditionalKeysToMatch is an additional list of keys outside of the default keys that will be matched when messages are returned after a form is submitted. |
List<String> |
getErrors()
The list of error messages found for the keys that were matched on this ValidationMessages This is generated and cannot be set |
List<String> |
getInfos()
The list of info messages found for the keys that were matched on this ValidationMessages This is generated and cannot be set |
protected List<String> |
getKeys(Component parent)
Gets all the keys associated to this ValidationMessages. |
protected List<String> |
getMessages(View view,
String key,
List<List<ErrorMessage>> lists)
Gets all the messages from the list of lists passed in (which are lists of ErrorMessages associated to the key) and uses the configuration service to get the message String associated. |
List<String> |
getWarnings()
The list of warning messages found for the keys that were matched on this ValidationMessages This is generated and cannot be set |
boolean |
isDisplayMessages()
If true, error, warning, and info messages will be displayed (provided they are also set to display). |
void |
setAdditionalKeysToMatch(List<String> additionalKeysToMatch)
|
void |
setAdditionalKeysToMatch(String additionalKeysToMatch)
Convenience setter for additional keys to match that takes a string argument and splits on comma to build the list |
void |
setDisplayMessages(boolean displayMessages)
|
protected void |
setErrors(List<String> errors)
Sets errors |
protected void |
setInfos(List<String> infos)
Sets infos |
protected void |
setWarnings(List<String> warnings)
Sets warnings |
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions |
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, preventModification, setComponentCode, setNamespaceCode, unwrap |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean |
---|
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode |
Constructor Detail |
---|
public ValidationMessages()
Method Detail |
---|
public void generateMessages(View view, Object model, Component parent)
view
- the current Viewmodel
- the current modelparent
- the parent of this ValidationMessagesprotected List<String> getMessages(View view, String key, List<List<ErrorMessage>> lists)
view
- key
- lists
-
protected List<String> getKeys(Component parent)
protected void addNestedGroupKeys(Collection<String> keyList, Component component)
keyList
- component
- public List<String> getAdditionalKeysToMatch()
public void setAdditionalKeysToMatch(String additionalKeysToMatch)
additionalKeysToMatch
- String to parsepublic void setAdditionalKeysToMatch(List<String> additionalKeysToMatch)
additionalKeysToMatch
- the additionalKeysToMatch to setpublic boolean isDisplayMessages()
If true, error, warning, and info messages will be displayed (provided they are also set to display). Otherwise, no messages for this ValidationMessages container will be displayed (including ones set to display). This is a global display on/off switch for all messages.
Other areas of the screen react to a display flag being turned off at a certain level, if display is off for a field, the next level up will display that fields full message text, and if display is off at a section the next section up will display those messages nested in a sublist.
public void setDisplayMessages(boolean displayMessages)
displayMessages
- the displayMessages to setpublic List<String> getErrors()
public List<String> getWarnings()
public List<String> getInfos()
protected void addValidationDataSettingsValue(Map<String,Object> valueMap, Map<String,String> defaults, String key, Object value)
valueMap
- the data map being constructeddefaults
- defaults for validation messageskey
- the variable name being addedvalue
- the value set on this objectprotected void setErrors(List<String> errors)
errors
- protected void setWarnings(List<String> warnings)
warnings
- protected void setInfos(List<String> infos)
infos
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |