Announcement Announcement Module
No announcement yet.
Example of a Master Detail Form Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example of a Master Detail Form

    Does anyone have an example of an editable Master - Detail form scenario? Most of the example code in the petstore and petclinic seems to be examples where one item is edited at a time.

    How would you set up your form controller and your binds in the jsp if you wanted to edit multiple line items of some object, ala grid control style.


  • #2
    This might help.


    • #3
      I've recently implemented a master-detail situation in Spring MVC. The JIRA issue (the link provided by sjivan) was a good starting point. Indeed, allmost all intuitive property paths like "detail[3].address[0].streetName" just work on the BeanWrapper, and therefore also in your MVC forms.

      As is said already in the referenced JIRA issue, you will need indexed access. So you should have an Array, List or Map of details in your master. If you have a Set (like I did), just create a Helper wrapper class.
      Indeed, a Map also works, I tried it out on a BeanWrapper instance, before designing my forms.

      This all seems undocumented, or I can't find it. It's not in the reference and it's not in Rod Johnson's two books (j2ee d+d and j2ee w/o ejb)!