org.kuali.rice.krad.uif.element
Class ValidationMessages

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.element.ContentElementBase
                  extended by org.kuali.rice.krad.uif.element.ValidationMessages
All Implemented Interfaces:
Serializable, Cloneable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, ContentElement, org.springframework.core.Ordered
Direct Known Subclasses:
FieldValidationMessages, GroupValidationMessages

public class ValidationMessages
extends ContentElementBase

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.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
ValidationMessages()
           
 
Method Summary
protected  void addValidationDataSettingsValue(Map<String,Object> valueMap, Map<String,String> defaults, String key, Object value)
           
protected
<T> void
copyProperties(T component)
          Copies the properties over for the copy method
 void generateMessages(boolean reset, 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.
 Map<String,String> getValidationDataDefaults()
           
 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 performFinalize(View view, Object model, Component parent)
          PerformFinalize will generate the messages and counts used by the errorsField based on the keys that were matched from the MessageMap for this ValidationMessages.
 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)
           
 void setErrors(List<String> errors)
           
 void setInfos(List<String> infos)
           
 void setValidationDataDefaults(Map<String,String> validationDataDefaults)
           
 void setWarnings(List<String> warnings)
           
 
Methods inherited from class org.kuali.rice.krad.uif.element.ContentElementBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, isUseAjaxCallForContent, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setUseAjaxCallForContent, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getLabelFromCamelCasedName, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isUseAjaxCallForContent, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setUseAjaxCallForContent, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Constructor Detail

ValidationMessages

public ValidationMessages()
Method Detail

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
PerformFinalize will generate the messages and counts used by the errorsField based on the keys that were matched from the MessageMap for this ValidationMessages. It will also set up nestedComponents of its parentComponent correctly based on the flags that were chosen for this ValidationMessages.

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
parent - - parent component
See Also:
FieldBase.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

generateMessages

public void generateMessages(boolean reset,
                             View view,
                             Object model,
                             Component parent)
Generates the messages based on the content in the messageMap

Parameters:
reset - true to reset the errors, warnings, and info lists
view - the current View
model - the current model
parent - the parent of this ValidationMessages

getKeys

protected List<String> getKeys(Component parent)
Gets all the keys associated to this ValidationMessages. This includes the id of the parent component, additional keys to match, and the bindingPath if this is an ValidationMessages for an InputField. These are the keys that are used to match errors with their component and display them as part of its ValidationMessages.

Returns:

getAdditionalKeysToMatch

public 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. These keys are only used for displaying messages generated by the server and have no effect on client side validation error display.

Returns:
the additionalKeysToMatch

setAdditionalKeysToMatch

public void setAdditionalKeysToMatch(String additionalKeysToMatch)
Convenience setter for additional keys to match that takes a string argument and splits on comma to build the list

Parameters:
additionalKeysToMatch - String to parse

setAdditionalKeysToMatch

public void setAdditionalKeysToMatch(List<String> additionalKeysToMatch)
Parameters:
additionalKeysToMatch - the additionalKeysToMatch to set

isDisplayMessages

public 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.

Returns:
the displayMessages

setDisplayMessages

public void setDisplayMessages(boolean displayMessages)
Parameters:
displayMessages - the displayMessages to set

getErrors

public 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

Returns:
the errors

getWarnings

public 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

Returns:
the warnings

getInfos

public 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

Returns:
the infos

getValidationDataDefaults

public Map<String,String> getValidationDataDefaults()

setValidationDataDefaults

public void setValidationDataDefaults(Map<String,String> validationDataDefaults)

addValidationDataSettingsValue

protected void addValidationDataSettingsValue(Map<String,Object> valueMap,
                                              Map<String,String> defaults,
                                              String key,
                                              Object value)

setErrors

public void setErrors(List<String> errors)

setWarnings

public void setWarnings(List<String> warnings)

setInfos

public void setInfos(List<String> infos)

copyProperties

protected <T> void copyProperties(T component)
Description copied from class: ComponentBase
Copies the properties over for the copy method

Overrides:
copyProperties in class ComponentBase
Parameters:
component - base bean
See Also:
ComponentBase.copy()


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.