Author: chris.laprun(a)jboss.com
Date: 2012-02-28 11:00:50 -0500 (Tue, 28 Feb 2012)
New Revision: 8477
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/AbstractValidator.java
Log:
- GTNPORTAL-2361: Fixed improper error message.
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/AbstractValidator.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/AbstractValidator.java 2012-02-28
14:49:58 UTC (rev 8476)
+++
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/AbstractValidator.java 2012-02-28
16:00:50 UTC (rev 8477)
@@ -48,7 +48,7 @@
}
label = label.trim();
-
+
// remove trailing ':' if there is one
int index = label.indexOf(':');
if(index != -1)
@@ -74,9 +74,14 @@
protected MessageException createMessageException(String value, UIFormInput uiInput)
throws Exception
{
- return new MessageException(new ApplicationMessage(getMessageLocalizationKey(),
getMessageArgs(value, uiInput), ApplicationMessage.WARNING));
+ return createMessageException(value, uiInput, getMessageLocalizationKey());
}
+ protected MessageException createMessageException(String value, UIFormInput uiInput,
String localizationKey) throws Exception
+ {
+ return new MessageException(new ApplicationMessage(localizationKey,
getMessageArgs(value, uiInput), ApplicationMessage.WARNING));
+ }
+
protected Object[] getMessageArgs(String value, UIFormInput uiInput) throws Exception
{
return new Object[]{getLabelFor(uiInput)};
@@ -101,7 +106,7 @@
if(exceptionOnMissingMandatory && value == null)
{
- throw createMessageException("EmptyFieldValidator.msg.empty-input",
uiInput);
+ throw createMessageException(value, uiInput,
"EmptyFieldValidator.msg.empty-input");
}
return value;
Show replies by date