Announcement Announcement Module
Collapse
No announcement yet.
Compound binding of multiple HTML elements to one property Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compound binding of multiple HTML elements to one property

    Though somewhat familiar with custom PropertyEditors and the initBinder method of Controller, I am struggling to figure out how to bind the combination of two submission fields to a single property of the command object.

    Example:
    An HTML form that allows the user to input a date with dropdowns for month, day, and year that maps/binds to a java.util.Date property of the form-backing command object.

    While it would be fun to write the "Hibernate" of Object-HTML-Mapping in the long-term, in the short-term I'm hoping that at least a case-specific mapping can be plugged in easily to Spring somwhere. Any suggestions?

    - Michael Alford

  • #2
    bind the combination of two submission fields to a single property of the command object
    You need 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

    Working...
    X