You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ca...@apache.org on 2007/03/12 22:23:38 UTC
svn commit: r517405 - in
/myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator:
DoubleRangeValidator.java LengthValidator.java LongRangeValidator.java
Author: cagatay
Date: Mon Mar 12 14:23:37 2007
New Revision: 517405
URL: http://svn.apache.org/viewvc?view=rev&rev=517405
Log:
Add generic label option support to validationexception messages
Modified:
myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/DoubleRangeValidator.java
myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LengthValidator.java
myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LongRangeValidator.java
Modified: myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/DoubleRangeValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/DoubleRangeValidator.java?view=diff&rev=517405&r1=517404&r2=517405
==============================================================================
--- myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/DoubleRangeValidator.java (original)
+++ myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/DoubleRangeValidator.java Mon Mar 12 14:23:37 2007
@@ -77,7 +77,7 @@
if (dvalue < _minimum.doubleValue() ||
dvalue > _maximum.doubleValue())
{
- Object[] args = {_minimum, _maximum,uiComponent.getId()};
+ Object[] args = {_minimum, _maximum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, NOT_IN_RANGE_MESSAGE_ID, args));
}
}
@@ -85,7 +85,7 @@
{
if (dvalue < _minimum.doubleValue())
{
- Object[] args = {_minimum,uiComponent.getId()};
+ Object[] args = {_minimum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MINIMUM_MESSAGE_ID, args));
}
}
@@ -93,7 +93,7 @@
{
if (dvalue > _maximum.doubleValue())
{
- Object[] args = {_maximum,uiComponent.getId()};
+ Object[] args = {_maximum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MAXIMUM_MESSAGE_ID, args));
}
}
@@ -113,7 +113,7 @@
}
catch (NumberFormatException e)
{
- Object[] args = {uiComponent.getId()};
+ Object[] args = {_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, TYPE_MESSAGE_ID, args));
}
}
Modified: myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LengthValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LengthValidator.java?view=diff&rev=517405&r1=517404&r2=517405
==============================================================================
--- myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LengthValidator.java (original)
+++ myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LengthValidator.java Mon Mar 12 14:23:37 2007
@@ -76,7 +76,7 @@
{
if (length < _minimum.intValue())
{
- Object[] args = {_minimum,uiComponent.getId()};
+ Object[] args = {_minimum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MINIMUM_MESSAGE_ID, args));
}
}
@@ -85,7 +85,7 @@
{
if (length > _maximum.intValue())
{
- Object[] args = {_maximum,uiComponent.getId()};
+ Object[] args = {_maximum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MAXIMUM_MESSAGE_ID, args));
}
}
Modified: myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LongRangeValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LongRangeValidator.java?view=diff&rev=517405&r1=517404&r2=517405
==============================================================================
--- myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LongRangeValidator.java (original)
+++ myfaces/core/branches/jsf12/api/src/main/java/javax/faces/validator/LongRangeValidator.java Mon Mar 12 14:23:37 2007
@@ -77,7 +77,7 @@
if (dvalue < _minimum.longValue() ||
dvalue > _maximum.longValue())
{
- Object[] args = {_minimum, _maximum,uiComponent.getId()};
+ Object[] args = {_minimum, _maximum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, NOT_IN_RANGE_MESSAGE_ID, args));
}
}
@@ -85,7 +85,7 @@
{
if (dvalue < _minimum.longValue())
{
- Object[] args = {_minimum,uiComponent.getId()};
+ Object[] args = {_minimum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MINIMUM_MESSAGE_ID, args));
}
}
@@ -93,7 +93,7 @@
{
if (dvalue > _maximum.longValue())
{
- Object[] args = {_maximum,uiComponent.getId()};
+ Object[] args = {_maximum,_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, MAXIMUM_MESSAGE_ID, args));
}
}
@@ -113,7 +113,7 @@
}
catch (NumberFormatException e)
{
- Object[] args = {uiComponent.getId()};
+ Object[] args = {_MessageUtils.getLabel(facesContext, uiComponent)};
throw new ValidatorException(_MessageUtils.getErrorMessage(facesContext, TYPE_MESSAGE_ID, args));
}