Results 1 to 6 of 6

Thread: Date Picker recommendation

  1. #1
    Join Date
    Aug 2005
    Location
    London (the English one!)
    Posts
    378

    Default Date Picker recommendation

    Hi

    I noticed that the latest datepicker recommendation was in 2007, surely something better and easier is now available.

    Could you recommend a small javascript datepicker that works nicely with Spring MVC and Spring Form? Thanks!

    Also, how would you do the conversion from the form to the JODA LocalDate format in my class? A link to a detailed example would be great!

    Many thanks

    Benoit

  2. #2
    Join Date
    Jun 2009
    Posts
    190

    Default

    Hi,

    You can try using the scriptaculous which has a datepicker.js file. It works well with Spring MVC.

    -Hetal

  3. #3
    Join Date
    Aug 2005
    Location
    London (the English one!)
    Posts
    378

    Default

    Thanks. I had a quick look at http://script.aculo.us but not sure where it is... would you have a url for it? Thanks!

  4. #4
    Join Date
    Jun 2009
    Posts
    190

  5. #5
    Join Date
    Jun 2009
    Posts
    190

  6. #6
    Join Date
    Aug 2005
    Location
    London (the English one!)
    Posts
    378

    Default

    Thanks a lot Hetal.

    How about doing the conversion from a JODA LocalDate to the form and back?

    When I create the Object used as command,
    Code:
    class Param {
    @NotNull
    private LocalDate date;
    ...}
    Controller
    Code:
    ...
    model.addAttribute("param", new Param(date));
    Code:
    <sf:form action="adjust.html" method="post"
    		commandName="param">
    <sf:input path="date" id="date" />
    ...
    </sf:form>
    It gets displayed as 14/01/2010 which is ok, although a bit weird since the toString() on a LocalDate does yyyy-mm-dd.

    But on the handler of adjust command, the object has a NULL date!

    Code:
    @RequestMapping(value = "/adjust", method = RequestMethod.POST)
    public String adjust(@Valid @ModelAttribute("param") final WebSwapProxyDelta parameter, final BindingResult result) {
    
    parameter.getDate() is null!
    Questions:
    1/ why is null? Surely I'm missing a conversion somewhere...
    2/ How come it was not validated (I have Hibernate Validator in the classpath)

    A pointer to an article / blog / end-to-end example with date/joda conversion would be great

    Many thanks

    B

Tags for this Thread

Posting Permissions

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