Results 1 to 3 of 3

Thread: DateTimeFormat: generated Form

  1. #1
    Join Date
    Jan 2010
    Posts
    7

    Default DateTimeFormat: generated Form

    Hello,

    actually I'm quite new to roo. I need for my project a field with a datetime and a field only with the time.

    Code:
    @DateTimeFormat(style = "SS")
    In case of the datetime field I changed the @DateTimeFormat style parameter to SS. The generated form is ok; actually it shows a calendar with the current month. After selecting a date it fills the form with a concrete date with the time 00:00. One minor problem is, changing the time and then change the date again will cause the loose of the time. Is there a way to prevent that behavior?
    Code:
    @DateTimeFormat(style = "-S")
    For the time field I changed the style to “-S”. But the generated form shows the date selector. After selecting a date it fills the field with “00:00”. So the format is correct, but the workflow isn’t userfriendly. Is there a way to solve this issue, without changing the view? It doesn’t matter if I choose java.util.date oder calendar.

    Down below the roo.log for a short test project.

    Yours,
    mab.

    Code:
    project --topLevelPackage de.mab.datetime
    persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY 
    entity --class ~.domain.Timer --testAutomatically 
    field date --fieldName datetime --type java.util.Date
    logging setup --level INFO 
    controller all --package ~.web
    perform package
    perform tests

  2. #2

    Default

    I have the same question here

    Does someone know how to pick only a time value ?

  3. #3
    Join Date
    Dec 2011
    Posts
    14

    Default

    change the widget type in the datetime.tagx from datetextbox to timetextbox.

Posting Permissions

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