11 Replies Latest reply on Mar 30, 2007 8:57 PM by tony.herstell1

    datePicker - Doco

    tony.herstell1

      To get the dat picker to work I had to find the .js file (that was not trivial.. but I finally found it in the ui example!)

      I copied that into my project.

      I then referenced the .js from the page where it's used.

      <script language="javascript" type="text/javascript" src="#{basePath}js/calendar.js"></script>
      



      Could this be added to the manual.

      You spoil us... so I just thought adding the tag would automagically give me a date picker.

        • 1. Re: datePicker - Doco
          shane.bryzak

          If you use the s:selectDate tag then the Javascript is automatically imported for you.

          • 2. Re: datePicker - Doco
            tony.herstell1

            ddint work for me.

            • 3. Re: datePicker - Doco
              tony.herstell1

              probably relies on some sort of "seam gen" project structure or summat.
              I have my structure allied with my IDE so that I dont have to use Ant.

              • 4. Re: datePicker - Doco
                pmuir

                Nope, nothing to do with seam-gen. You do need Seam 1.2

                • 5. Re: datePicker - Doco
                  tony.herstell1

                  I am using seam 1.2.1 GA

                  • 6. Re: datePicker - Doco
                    tony.herstell1

                     

                     <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>
                    


                    • 7. Re: datePicker - Doco
                      gavin.king

                      You must have the resource servlet installed.

                      • 8. Re: datePicker - Doco
                        tony.herstell1

                         

                        <web-app version="2.5"
                         xmlns="http://java.sun.com/xml/ns/javaee"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                        
                         <!-- Seam -->
                        
                         <listener>
                         <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                         </listener>
                        
                         <!-- Propagate conversations across redirects -->
                        
                         <filter>
                         <filter-name>Seam Redirect Filter</filter-name>
                         <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
                         </filter>
                        
                         <filter-mapping>
                         <filter-name>Seam Redirect Filter</filter-name>
                         <url-pattern>*.seam</url-pattern>
                         </filter-mapping>
                        
                         <!-- JSF -->
                        
                         <context-param>
                         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                         <param-value>client</param-value>
                         </context-param>
                        
                         <context-param>
                         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                         <param-value>.xhtml</param-value>
                         </context-param>
                        
                         <context-param>
                         <param-name>facelets.DEVELOPMENT</param-name>
                         <param-value>true</param-value>
                         </context-param>
                        
                         <servlet>
                         <servlet-name>Faces Servlet</servlet-name>
                         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                         <load-on-startup>1</load-on-startup>
                         </servlet>
                        
                         <!-- Faces Servlet Mapping -->
                        
                         <servlet-mapping>
                         <servlet-name>Faces Servlet</servlet-name>
                         <url-pattern>*.seam</url-pattern>
                         </servlet-mapping>
                        
                         <!-- MyFaces -->
                        
                         <listener>
                         <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                         </listener>
                        
                         <!-- Session Timeout -->
                         <session-config>
                         <session-timeout>15</session-timeout>
                         </session-config>
                        
                        </web-app>
                        
                        


                        in faces.config

                         <!-- Facelets support -->
                        
                         <application>
                         <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                         </application>
                        
                         <!-- Select one of the two standard persistence lifecycle models for the Seam application -->
                        
                         <lifecycle>
                         <phase-listener>
                         org.jboss.seam.jsf.SeamPhaseListener
                         </phase-listener>
                         </lifecycle>
                        
                         <!-- My Messages Please -->
                         <application>
                         <message-bundle>de.co.clickstream.i18n.jsfstandarderrors</message-bundle>
                         </application>
                        


                        What do I need to change?

                        • 9. Re: datePicker - Doco
                          gavin.king
                          • 10. Re: datePicker - Doco
                            tony.herstell1

                            Thanks Gavin for you help. The dates now arrive correctly :)

                            I have got rid of my local copy of the .js and .css

                            Perhaps this info might go in Chapter 24, JMF Seam Controls, under the <s:slectDate> area.

                            A VERY useful, if unfortuantely incomplete chapter.

                            • 11. Re: datePicker - Doco
                              tony.herstell1

                               

                              "gavin.king@jboss.com" wrote:
                              You must have the resource servlet installed.


                              I actually though you meant I had it installed when I shouldn't have!

                              So was posting my code to show I didnt have it there.

                              Sorry.