0 Replies Latest reply on Nov 16, 2007 12:04 PM by Marco Barbi

    HtmlCalendar bugs ?

    Marco Barbi Newbie

      Hi,

      I've been experiencing the following issue with the HtmlCalendar and I'm wondering if it's due to a bug (RichFaces 3.1.2GA).

      The component is created with the following code snippet:

      HtmlCalendar calendar = new HtmlCalendar();
       calendar.setInputClass("dateFormatInput");
       calendar.setId(fieldId);
       calendar.setPopup(true);
       String format = "dd/MM/yyyy";
       calendar.setDatePattern(format);
       calendar.setValue(new Date());


      The first time the page containing the component is rendered, the calendar is correctly dispalyed. However, if I move to another page (via a regular action) and come back to this page again (via another regular action), I get this exception:

      GRAVE: Error Rendering View[/pages/granted/companyProfile.jspx]
      java.lang.NullPointerException
       at org.richfaces.renderkit.CalendarRendererBase.getSelectedDate(CalendarRendererBase.java:367)
       at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:225)
       at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:436)
       at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)
       at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:326)
       at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:321)
       at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
       at org.richfaces.renderkit.html.SimpleTogglePanelRenderer.encodeChildren(SimpleTogglePanelRenderer.java:185)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:199)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
       at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)


      I also paste the component state as reported by facelets along with the exception:

      <HtmlCalendar ajaxSingle="true" boundaryDatesMode="inactive"
       bypassUpdates="false" datePattern="dd/MM/yyyy"
      direction="bottom-right" disabled="false" enableManualInput="false"
      height="250px" horizontalOffset="0" id="sdf_363"
      ignoreDupResponses="false" immediate="false"
      inputClass="dateFormatInput" jointPoint="bottom-left" limitToList="false"
       localValueSet="true" locale="it_IT" mode="client" popup="true"
      preloadDateRangeBegin="Thu Nov 01 17:50:36 CET 2007"
      preloadDateRangeEnd="Fri Nov 30 17:50:36 CET 2007" rendered="true"
      requestDelay="-2147483648" required="false" showInput="true"
      submittedValue="16/11/2007"
      timeZone="sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,
      dstSavings=3600000,useDaylight=true,transitions=143,
      lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,
      dstSavings=3600000,
      useDaylight=true,startYear=0,startMode=2,startMonth=2,
      startDay=-1,startDayOfWeek=1,startTime=3600000,
      startTimeMode=2,endMode=2,endMonth=9,endDay=-1,
      endDayOfWeek=1,endTime=3600000,endTimeMode=2]]" timeout="-2147483648"
      toolTipMode="batch" transient="false" valid="true"
      value="Fri Nov 16 17:50:36 CET 2007" verticalOffset="0"
      width="400px;" zindex="3"/>


      The component state seems to be ok so I cannot figure out why this excpetion rises.

      Thanks.
      Marco