Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Date Picker for Spring webflow 2.0.2

  1. #1

    Default 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. #2
    Join Date
    May 2008
    Posts
    227

    Default

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

  3. #3

    Default

    Thanks for the reply

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


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


    Sudheesh

  4. #4
    Join Date
    Aug 2005
    Location
    Boise, Idaho
    Posts
    8

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

  5. #5

    Default

    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

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7

    Default

    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. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    As I mentioned it is part of Webflow 2, so download it, read the documentation and take a look at the samples.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  9. #9
    Join Date
    Feb 2010
    Posts
    4

    Default

    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 at 11:41 AM.

  10. #10
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •