I am using Tomahawk 1.1.6 with JDeveloper 11g-3 and running into a
slight problem customizing the inputCalendar control's conversion/error
messages. I have successfully followed the i18n type approach (example @
http://www.jsf-faq.com/faqs/faces-messages.html, #126) to get custom
error messages for simple controls like input boxes. However, I tried to
use the same approach with the inputCalendar but it continues to give me
a default conversion/error message instead of my own.

Here are the steps I have taken so far ...

1. Created & registered a custom class that implements the Converter
class with its getAsObject and getAsString methods.
2. Added a converter attribute for the calendar control in my JSP page,
pointing to the above custom class.
3. Created & registered a message bundle file (per i18n approach) and
added custom conversion/error messages for the calendar.

The first 2 steps are included because I also wanted to limit what
formats the user can enter in the date field. From what I understand,
these 2 steps will determine if the conversion succeeds or fails, but to
actually change the error message that is displayed, I have to correctly
implement the 3rd step. Since I can see the first 2 steps executing
properly during debugging, my guess is that the problem is in the 3rd
step ... more specifically I think maybe I am not putting the correct
key/value pair in message bundle file? I have listed the contents of my
message bundle file below ... I know that most of these entries are
probably not correct but I was just shooting in the dark and trying out
all variations that I thought might work!

#--- message bundle file: start ---

javax.faces.convert.ConverterException.CONVERSION=Java Conversion
message1
javax.faces.convert.ConverterException.CONVERSION_detail=Java Conversion
message1

javax.faces.convert.DateTimeConverter.CONVERSION=Java Conversion
message2
javax.faces.convert.DateTimeConverter.CONVERSION_detail=Java Conversion
message2

org.apache.myfaces.calendar.CONVERSION=Apache Conversion message1
org.apache.myfaces.calendar.CONVERSION_detail=Apache Conversion message1

org.apache.myfaces.custom.calendar.CONVERSION=Apache Conversion message2
org.apache.myfaces.custom.calendar.CONVERSION_detail=Apache Conversion
message2

org.apache.myfaces.custom.calendar.HtmlInputCalendar.CONVERSION=Apache
Conversion message3
org.apache.myfaces.custom.calendar.HtmlInputCalendar.CONVERSION_detail=A
pache Conversion message3

#--- message bundle file: stop ---

A similar question was posted in this list in June 2007 but its answer
did not resolve my issue. If somebody knows the correct key/value pair
to use in my situation, or thinks that something else is the issue,
please let me know. Thanks!

Regards,
Usman



NOTE: The information in this email may be confidential and legally
privileged. If you are not the intended recipient, you must not
read, use or disseminate the information; please advise the sender
immediately by reply email and delete this message and any
attachments without retaining a copy. Although this email and any
attachments are believed to be free of any virus or other defect
that may affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by RGIS, LLC for
any loss or damage arising in any way from its use.

Reply via email to