2 Replies Latest reply on May 23, 2007 4:46 AM by Andreas Franke

    Dte Pciker not interested in my formatter

    Tony Herstell Master

      Using:

       <td>
       <s:decorate>
       <h:inputText id="dateEffectiveTo" value="#{user.dates.dateEffectiveTo}">
       <s:convertDateTime pattern="dd/MM/yyyy"/>
       </h:inputText>
       <s:selectDate for="dateEffectiveTo" startYear="2007" dateFormat="dd/MM/yyyy">
       <h:graphicImage url="#{basePath}/images/datepicker.gif" style="margin-left:5px;cursor:pointer"/>
       </s:selectDate>
       </s:decorate>
       </td>
      


      if I use the date pickler it always posts back to the text field as
      MM/dd/yyyy

      e.g.
      field is defaulted to:
      31/03/2007

      pick 21st from date picker and fiels is set to:
      03/21/2007


        • 1. Re: Date Picker not interested in my formatter
          Tony Herstell Master

          Gavin solved this...
          You must install the resource servlet.

           <!-- Resource Servlet (used for Date picker etc.) -->
          
           <servlet>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
          


          • 2. Re: Dte Pciker not interested in my formatter
            Andreas Franke Apprentice

            Hi have exactly the same problem and already put resource servlet to web.xml

            If I pick 1st June it result in 06/01/2007 instead of 01/06/2007

            <s:decorate id="dateDecorator" template="edit.xhtml">
             <h:inputText value="#{specialrelease.valideToDate}" id="validToDate" required="true">
             <s:convertDateTime pattern="dd/MM/yyyy"/>
             <a:support event="onblur" reRender="dateDecorator"/>
             </h:inputText>
             <s:selectDate for="validToDate" dateFormat="dd/MM/yyyy">
             <h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"></h:graphicImage>
             </s:selectDate>
             <s:message/>
            </s:decorate>
            


            Use JBoss Seam 1.2.1
            jboss-seam-ui.jar is placed in WEB-INF/lib folder