Form control: One-to-many select
The oneToManySelect
control is a variation of the Object picker that allows you to select all the related records that should "belong" to the current record (the record that you are in the process of creating / editing).
For example, you may have a user group relationship where a user can belong to zero or one group. In the group
object, you could define a users
property with a one-to-many
relationship and have it use the oneToManySelect
form control. When creating or editing a group, you can then define directly which users belong to the group.
Arguments
This control has no custom arguments.
Example
// /preside-objects/user.cfc
...
property name="group" relationship="many-to-one" relatedTo="group";
...
// /preside-objects/group.cfc
...
property name="users" relationship="one-to-many" relatedTo="user" relationshipKey="group";
...
<!-- /forms/preside-objects/group/admin.edit.xml -->
<!-- /forms/preside-objects/group/admin.add.xml -->
<!-- ... -->
<field binding="group.users" control="oneToManySelect" />