org.kuali.rice.krad.uif.element
Class ValidationMessages
java.lang.Object
org.kuali.rice.krad.datadictionary.DictionaryBeanBase
org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
org.kuali.rice.krad.uif.component.ComponentBase
org.kuali.rice.krad.uif.element.ContentElementBase
org.kuali.rice.krad.uif.element.ValidationMessages
- All Implemented Interfaces:
- Serializable, 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
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Method Summary |
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. |
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)
|
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase |
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, 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, 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, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth |
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, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth |
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 |
ValidationMessages
public ValidationMessages()
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 renderingmodel
- - top level object containing the dataparent
- - 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 listsview
- the current Viewmodel
- the current modelparent
- 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
Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.