5 Replies Latest reply on Jan 15, 2008 3:45 AM by Jaime Martin

    Date parameter at s:button

    Manuel Aznar Pérez Newbie

      I have :

      In jsf "lstEstablecimientos":

      <s:button view="/lstEstablecimientosLista.seam" id="listado" value="#{messages['verLstEstablecimientos.button']}" action="#{lstEstablecimientosLista.listadoAv}">
      
      <f:param name="diaLlegada" value="#{lstEstablecimientos.diaLlegada}"/>
      
      </s:button>
      


      In bean stateful "lstEstablecimientosBean":

      private Date diaLlegada;
      ...
       public Date getDiaLlegada() {
       return diaLlegada;
       }
      
       public void setDiaLlegada(Date diaLlegada) {
       this.diaLlegada = diaLlegada;
       }
      


      In bean stateful "lstEstablecimientosListaBean" = "lstEstablecimientosBean":

      private Date diaLlegada;
      ...
       public Date getDiaLlegada() {
       return diaLlegada;
       }
      
       public void setDiaLlegada(Date diaLlegada) {
       this.diaLlegada = diaLlegada;
       }
      


      When I press button throws this exception :

      12:08:11,069 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) beforePhase.
      javax.faces.convert.ConverterException: java.text.ParseException: Unparseable date: "Mon Jan 08 00:00:00 CET 2007"
       at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:86)
       at org.jboss.seam.core.Pages.applyRequestParameterValues(Pages.java:531)
       at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:186)
       at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:51)
      
      .
      .
      .
      
      Caused by: java.text.ParseException: Unparseable date: "Mon Jan 08 00:00:00 CET 2007"
       at java.text.DateFormat.parse(DateFormat.java:335)
       at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:82)
       ... 31 more
      
      


      Put date how string. How put I date in format "parseable" (ex: dd/MM/yyyy) in a <f:param>?

      Thanks.

        • 1. Re: Date parameter at s:button
          Jaime Martin Apprentice

          Hi, did you find any solution to this problem? the same is hapenning to me!

          • 2. Re: Date parameter at s:button
            Jaime Martin Apprentice

            By the way, in my case I am not using a s:button but a s:link.

             <s:link view="/RstInstrumentValuationExList.xhtml"
             id="rstInstrumentValuation2"
             rendered="#{(rstRepProc.rstProcess.rstStatus.code != 0)}">
             <h:graphicImage url="img/view.gif" border="0"/>
             <f:param name="processDate"
             value="#{rstRepProc.rstProcess.processDate}">
             </f:param>
             </s:link>
            


            processDate is a java.util.Date field, but in spite of that I have this error:


            16:46:22,119 ERROR [SeamPhaseListener] uncaught exception
            javax.faces.convert.ConverterException: java.text.ParseException: Unparseable date: "2006-08-31"
            at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:84)
            ...
            Caused by: java.text.ParseException: Unparseable date: "2006-08-31"
            at java.text.DateFormat.parse(DateFormat.java:335)
            at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:80)
            ... 44 more
            16:46:22,181 ERROR [SeamPhaseListener] swallowing exception
            javax.faces.convert.ConverterException: java.text.ParseException: Unparseable date: "2006-08-31"
            at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:84)
            at org.jboss.seam.pages.Param.getValueFromRequest(Param.java:144)
            at org.jboss.seam.core.Pages.applyRequestParameterValues(Pages.java:633)
            ..
            Caused by: java.text.ParseException: Unparseable date: "2006-08-31"
            at java.text.DateFormat.parse(DateFormat.java:335)
            at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:80)
            ... 44 more



            I have tried with convertDateTime this way:
             <f:param name="processDate"
             value="#{rstRepProc.rstProcess.processDate}">
             <s:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy"/>
             </f:param>
            


            Using s:convertDateTime the following error happens:

            /RstReport.xhtml @318,112 <s:convertDateTime> Parent not an instance of ValueHolder: javax.faces.component.UIParameter@59227c


            any idea? thank you!

            • 3. Re: Date parameter at s:button
              Marc Canaleta Newbie

              I also have this problem... You can specify a converterId at the parameter specification at pages.xml but not at f:param... Anyone knows the solution? Thanks!

              • 4. Re: Date parameter at s:button
                Nicklas Karlsson Master

                Tried passing along the time as a long value?

                • 5. Re: Date parameter at s:button
                  Jaime Martin Apprentice

                  Yeah, passing a long value works ok and solves the problem.