Announcement Announcement Module
Collapse
No announcement yet.
Seperate date and time form fields, one date property Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Seperate date and time form fields, one date property

    Hi,

    I have an object in my domain called Game with a property called kickoff, of type java.util.Date.

    I want to have two seperate time and date form fields in my web form, that update the one kickoff property on the Game object.

    Is this possible? I suspect I need to use a PropertyEditor. Can anyone give me an example/overview of what to do.

    Martin

  • #2
    You can make a nested object that represents a date made of the individual properties. That nested object can then be made part of you command object.

    Comment


    • #3
      Sorry for being thick :oops: , but could you flesh it out for me a bit more.

      Martin

      Comment


      • #4
        This only works if it's OK to alter you command object.
        Instead of your kickoff property of the command object being of type java.util.Date, make it a custom object e.g.:
        Code:
        public class MyDate {
            ...
            setDate(...){...}
            setTime(...){...}
        }
        ...using nesting you can bind directly to this as part of your command object.

        Comment

        Working...
        X