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

  • Date Picker for Spring webflow 2.0.2

    Hi,

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

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

    Comment


    • #3
      Thanks for the reply

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


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


      Sudheesh

      Comment


      • #4
        ExtJs has widgets - including a date chooser

        I have had some good success using ExtJs (extjs.com) 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.
        Code:
        <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.

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


        Hope that helps

        Comment


        • #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,
          Sudheesh

          Comment


          • #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.

            Comment


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

              Comment


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

                Comment


                • #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
                  Code:
                  <head>
                  <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"
                  type="text/javascript"></script>
                  
                  <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> 
                  </head>
                  code from my jsp page
                  Code:
                  <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 }})); 
                  </script>
                  Last edited by tapha; Feb 19th, 2010, 12:41 PM.

                  Comment


                  • #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...

                    Comment


                    • #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:
                      org.springframework.binding-2.0.8.RELEASE.jar
                      org.springframework.js-2.0.8.RELEASE.jar
                      org.springframework.webflow-2.0.8.RELEASE.jar

                      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.

                      Comment


                      • #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:

                        Code:
                        <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, 12:40 PM.

                        Comment

                        Working...
                        X