Announcement Announcement Module
No announcement yet.
Binding enums but displaying 'display name' in forms. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding enums but displaying 'display name' in forms.

    I have some jsps that have a command backing object with some enums types as fields. The jsps currently display the enums values in drop downs (provided by the referenceData method returning the enumtype.values().)

    Everything binds nicely currently so all is good.

    Now I have a change request wanting to display friendlier display names for each enum value. So I have updated my enums to have private strings for the display names and provided a getDisplayName() for each enum. So I can easily update the referenceData method to return these.

    However, how can I expect my commad object to be able to bind automatically the correct enum value from the dropdown selection? What do I need to do to make sure the binding will still work?

  • #2
    Check out PropertyEditorSupport