Jun 9th, 2009, 02:38 PM
Creating composite relation
I am trying to figure out if it is possible to create a composite relationship. When typing 'hint relationships' the example of order - orderline is given. If I understand correct you need two controller to handle this relationship in the front end. You get two forms, one for the order and one for de orderline.
Is it possible to create something that lets you create an orderline right from the order form? I do not want to let de user go to a different page to add orderlines.
Jun 9th, 2009, 07:35 PM
Indeed merging the handling of two separate entities which are related to each other through a single controller and view artefacts is currently not implemented. I imagine that this can become somewhat cumbersome if you have deeper nested objects such as Order -> OrderLine -> Product -> Manufacturer. If you want to manage all of these relationships through a single controller and view that would be hard to lay out.
Now you can overcome this by using some JS magic to use overlay forms but we also need to keep in mind that JS may be disabled by the user while the form should still be usable. I have written a small sample project which demonstrate the Spring integration with Dojo to accomplish this for an Account -> Investment relationship (http://tinyurl.com/n2hmld). Source code for this sample is available here: http://tinyurl.com/nke2u9.
I am happy about any suggestions on how this could be handled by Roo. Please open a Jira ticket and note your ideas!
Jun 9th, 2009, 11:55 PM
Ik can understand it would not be easy if you go the path like your example suggests. Of course the orderline - Product will not be a composition. But I get the point
I am just starting with ROO, when I get my head straight and played around with ROO I'll think about the problem and how to embed this kind of a solution in ROO. Than I'll add it to jira :-)
Your example looks very promising, I am definitely going to try it out.
Jun 10th, 2009, 07:17 PM
Sorry for the bad example . Yes, please play with it a little and let us know what would work for you.