Announcement Announcement Module
No announcement yet.
Date Picker for Spring webflow 2.0.2 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date Picker for Spring webflow 2.0.2


    I need a date picker ,Calendar Widget which can be

    1) Configured
    2) Can show multiple months(two months)

    Please advice me as what to do,

    Thanks In Advance,

  • #2
    try richfaces ,its well integrated with swf2,unless u have problem with the license


    • #3
      Thanks for the reply

      Am not using JSF , am using Spring MVC...

      Any other options..
      (I need to show two months cal)..



      • #4
        ExtJs has widgets - including a date chooser

        I have had some good success using ExtJs ( in combination with our Spring MVC forms also using Spring Webflow 2.0.2.

        You can lay out your form as a regular Spring MVC form with the date field you wish to use setup as a regular text field. Then ExtJs has some nice calls for their widgets to be applied to an existing element.

        Here's a quick example:

        This is my date input that lives in a spring managed form.
        <form:input id="reportDate" path="runForDate" />
        This is the javascript to attach the ext date field to my form element, which then provides a rich, robust, and even configurable date chooser that looks sweet too.

        var setupForm = function() {
        		var date = new Ext.form.DateField({
        					width: 90,
        	                allowBlank: false,
        	                blankText: 'The report date is required',
        	                applyTo: 'reportDate'
        The 'applyTo' attribute tells ExtJs to apply the new DateField object onto the element with the matching id, 'reportDate'.

        Hope that helps


        • #5
          Thanks for your reply.

          Can I use the extjs facilities commercialy?

          Is there anyway to customize the Dojo Calender that comes with Spring webflow?

          Do anybody know more abt the usage of Dojo Calender along with Spring webflow?

          Thanks In Advance,


          • #6
            Or use the Spring JavaScript extension, it is part of the new webflow distribution but works perfectly without Webflow. It is quite easy to integrate.


            • #7
              Thanks a lot for your reply,
              This may help me a lot

              Do we have any examples?

              Do I need to download any extra Jar for this


              • #8
                As I mentioned it is part of Webflow 2, so download it, read the documentation and take a look at the samples.


                • #9
                  Marten, thanks for the suggestion. I'm trying to use the calendar widget from spring javascript but i'm running into css problems and my calendar is not rendering correctly (no icons shown on the calendar object).

                  Code from the html head section
                  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                  <link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" />
                  <link href="css/style.css" rel="stylesheet" type="text/css">
                  <script language="JavaScript" src="js\tableH.js"
                  <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"></script>
                  <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
                  <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script> 
                  code from my jsp page
                  <form:input path="dateDemarrage" />
                  <script type="text/javascript">
                  	Spring.addDecoration(new Spring.ElementDecoration({
                  		elementId : "dateDemarrage",
                  		widgetType : "dijit.form.DateTextBox",
                  		widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }})); 
                  Last edited by tapha; Feb 19th, 2010, 11:41 AM.


                  • #10
                    For starters your page is invalid, the link loading your style.css is invalid, or the element is because it isn't closed.

                    Is it being rendered/acting as a calender widget? Try specifing the id attribute on the form:input because the path is not the same as the id...


                    • #11
                      Marten, the style.css is my own stylesheet; it functions correclty, I have now closed the tag. the calendar widget functions correctly as far as clicking on the input field and selecting a date. It just renders with a transparent background with no colors.

                      I have included on my classpath the following jars:

                      cause thats where the needed css and js files reside. I did add the id attribute on the form:input tag but I'm still receiving the same result. So I'm thinking is there anything i need to do after calling the Spring.addDecoration function.


                      • #12
                        Marten, date picker is now rendering correctly. when I looked at the booking-mvc sample, there is a css class added on the body tag as follow:

                        <body class="tundra spring">
                        It seems regardless of what type of css you have for your app, this one is critical in order to render the widgets correctly.

                        Thanks for the help...
                        Last edited by tapha; Feb 19th, 2010, 11:40 AM.