Greetings:

I try to use <x:inputCalendar> and have following issues. Hope to hear from someone who has used this good UI of myfaces (1.0.8 built from cvs):

1) Looking at the source of HtmlCalendarRenderer, i found it uses o.a.m.c.html.util.AddResource to link required resources used by the component. This means that i do not need to add the <script> tag for javascrips. I found this is NOT the case. I must add the <scrip> tag for jscalendar and its theme for the popup calendar. Looking at the source page, i saw the following script:

<script 
type="text/javascript">jscalendarSetImageDirectory("/faces/myFacesExtensionResource/calendar.HtmlCalendarRenderer/DB/")</script><input 
id="psi:pLeftDef0:_id8" name="psi:pLeftDef0:_id8" type="text" value="2/7/05"/><script type="text/javascript"><!--
jscalendarMonthName = new 
Array("January","February","March","April","May","June","July","August","September","October","November","December");jscalendarDayName = new 
Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");jscalendarStartAt = 0;
jscalendarTodayString = "Today is: ";
jscalendarWeekString = "Wk";
if (!document.layers) {
document.write("<input type='button' 
onclick='jscalendarPopUpCalendar(this,this.form.elements[\"psi:pLeftDef0:_id8\"],\"M/d/yy\")' 
value='...'/>");
}
--></script>

I do not want to add unneccessary javascripts and CSS to each page. Do i miss anything?

2) After appropriately changing jscalendar/popcalendar.js and preloading jscalendar js and its theme, i am able to have a nice calendar popup with all features as shown in the demo. It works properly with default US English. I translate the message resources popup_today_string and popup_week_string for i18n, which is supposely to work. When the application chage the locale setting, i get following exception:

*type* Exception report

*message*

*description* _The server encountered an internal error () that prevented it from fulfilling this request._

*exception*

javax.servlet.ServletException: Expected submitted value of type Date
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:125)

*root cause*

javax.faces.FacesException: Expected submitted value of type Date
        
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:410)
        
org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:220)
        
org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:206)
        
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:290)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)

*note* _The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs._

Has anyone experienced this issue and worked out a solution? Glancing through the source codes of javascripts, I saw some hard coded variables. How do i control the display of date format?

Thanks

BaTien
DBGROUPS



Reply via email to