Announcement Announcement Module
No announcement yet.
Multiple entity controller needed Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple entity controller needed

    Hi all

    I have a customer entity
    I have an activity entity

    They both share a key pack_id

    I wish to create a single screen for entering both customer and actity data and a single submit that writes to both tables.

    I have tried to creting both controllers and meerging code but running into issues.

    org.springframework.beans.NotReadablePropertyException: Invalid property 'customer_address1' of bean class
    I have taken the jsp for one of the entities and merged it with the other.

    There appears to be a mapping stage that falls over trying to place these extra elemetns on the customer objetct opposed to the activity object.

    As this class is within the framework was not sure how to progress.

    Has anyone else written to two elements from a single controller and jsp page using roo?



  • #2
    Hi Joe,

    As you noticed the scaffolded views have a 1:1 mapping between form backing objects and the view artifacts. If you would like to merge two entities into a single form you need to do some manual work. It would probably be best if you start with a 'controller class', create a custom form backing object (which contains the fields of both entities) and use that for your data exchange between the controller and your custom views.

    Alternatively, you can use something like Json as data exchange format as detailed in Keith Donalds bog post: