Multiple Models

Hello! I want to create a poll. I have two Models:


[*]Vote: general information about the poll like title, info, stop-date

[*]VoteOption: options for the poll


Now I want to create a "_form.php" where the user can input the general information and underneath the vote-options like in the screenshot. The special about it is, that the user should be able to add an remove the options with JavaScript. Saving the form will create or update or delete the vote-options.

How do I build up this process most effectivly? With loadMultiple / validateMultiple or are there better options? Are there any tutorials?

Has nobody an idea? Do you need more info?

Take a look at this widget, this should do what you want, see option "multiple"

Thanks, but that is not what I was searching… It is more like the example in the Guide Handling multiple models with a single form with the difference, that the user should be able to ADD and DELETE the items in the list.

Adding items with Javascript:

Adding items with JS is not the problem. I’d like to know how to handle the data in the Controller. loadMultiple / validateMultiple does not support create/delete models. It just updates the existing models.