This forum seems to be the one that gets the most activity and responses, so I'll post it here, but apologies in advance if there was a more appropriate place to post it.
I have a one-to-one relationship between two data objects Foo and Bar. Foo may have one Bar. Bar will be linked to one Foo.
Foo +--- Bar
In the ModelAdmin scaffolding, I would the user to be able to create or edit a Foo and at the same time create or edit its associated Bar. A second tab on the pop-up Foo form would make sense. The tab is kind of easy - getCMSFields() in the Foo data model can create individual fields or move fields to the second tab, and they all get submitted at once when the pop-up is saved.
Now, can Foo pull in a complete form for Bar into one of the tabs? If so, what happens when they are submitted, since fields in both Foo and Bar could have the same name? Is this simple to do with a few lines of code? Are we looking at an AJAX solution to keep the two forms separate? Or do I need to manually create the fields in Foo that Bar will use, and manually push them into a Bar DataObject on form submission of Foo?
Hope that makes sense!
-- Jason