When you have a simple list you use a Controller and when you are doing CRUD
a SimpleFormController.

But let's say you have an Object Company that has a Collection of Employees.
When you CRUD a Company you use a SimpleFormController. But when you want to
add an Employee to a Company, you open a page with a drop-down of Employees.
You select one, or many and click on Submit.

Now what? You wouldn't use a SimpleFormController because this assumes that
your Command Object (Company) will be mapped to the form and saved in the
companies table in the database. What you need to do is save the id's of the
Company and Employee in the companiesemployees table, for which no Command
Object exists.

If, for example, your companiesemployees table had other attributes, like
salary, then you'd have to create a CompanyEmployee Object to do the CRUD,
in which case I guess you wouldn't have this problem. But for simplicity's
sake, let's say we don't have attributes, and as such, don't have a
CompanyEmployee Object.

What's the best way to save this relation? I am sure I could come up with a
kludge solution and get it to work, but I was just wondering what the
experts say...

Many thanks!
Bob
-- 
View this message in context: 
http://www.nabble.com/Best-practices%3A-Which-Spring-MVC-Form-to-use--tf4259684s2369.html#a12122214
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to