Announcement Announcement Module
No announcement yet.
DomainClassConverter and spring form <select> tag Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • DomainClassConverter and spring form <select> tag

    Hi. Recently I'm start to notice strange behavior my select form inputs. When I'm trying to open form for editing some of my objects, the selected value in this inputs is completely wrong. And when I took a look into generated html I discovered than multiple options have 'selected' attributes in it.

    My selects are declared like this:

    <form:select path="someProperty" items="${items}" itemLabel="name" itemValue="id" />
    With such configuration I expected that selected value must be determined by equality of 'itemValue' property. But instead of this 'equals' method called by DomainClassConverter. And multiple selected values are the result of my faulty 'equals' method implementation.

    So, my question is: why DomainClassConverter involved in tag rendering?

    I'm using Spring Data MongoDB 1.1.1.RELEASE, Spring Framework 3.1.2.RELEASE.