You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/09/18 01:24:31 UTC
svn commit: r289861 -
/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
Author: mmarinschek
Date: Sat Sep 17 16:24:28 2005
New Revision: 289861
URL: http://svn.apache.org/viewcvs?rev=289861&view=rev
Log:
using org.apache.myfaces.calendar.CONVERSION for errors in the conversion process
Modified:
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java?rev=289861&r1=289860&r2=289861&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java Sat Sep 17 16:24:28 2005
@@ -23,9 +23,11 @@
import org.apache.myfaces.renderkit.html.HtmlRenderer;
import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
import org.apache.myfaces.renderkit.html.util.JavascriptUtils;
+import org.apache.myfaces.util.MessageUtils;
import org.apache.commons.lang.StringEscapeUtils;
import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UIParameter;
@@ -309,7 +311,7 @@
StringBuffer script = new StringBuffer();
defineStringArray(script, "jscalendarMonthName", months);
- defineStringArray(script, "jscalendarMonthName2", months);
+ defineStringArray(script, "jscalendarMonthName2", months);
defineStringArray(script, "jscalendarDayName", weekDays);
setIntegerVariable(script, "jscalendarStartAt",realFirstDayOfWeek);
@@ -746,6 +748,7 @@
public static class CalendarDateTimeConverter implements DateConverter
{
+ private static final String CONVERSION_MESSAGE_ID = "org.apache.myfaces.calendar.CONVERSION";
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
{
@@ -771,7 +774,9 @@
}
catch (ParseException e)
{
- throw new ConverterException(e);
+ FacesMessage msg = MessageUtils.getMessage(CONVERSION_MESSAGE_ID,new Object[]{
+ uiComponent.getId(),s});
+ throw new ConverterException(msg,e);
}
}