Setting values for multiple profiles is similar to setting values for a single profile. Input fields on a registration page are used to set the form handler’s value Dictionary, where data is stored pending a form submit operation such as create or update. On form submission, all values in the dictionary are written to the selected user profiles as a single transaction.

For detailed information about setting profile values, see Setting Profile Values earlier in this chapter.

Setting values for individual profiles

The MultiProfileAddFormHandler contains a users property, which is a list of all user profiles. This property provides access to the property values of individual profiles. The following example uses ForEach to iterate over all user profiles in users, and display text input fields for each one:

<dsp:droplet name="/atg/dynamo/droplet/ForEach">
  <dsp:param bean="MultiProfileAddFormHandler.users" name="array"/>
  <dsp:oparam name="output">
     <dsp:input bean="MultiProfileAddFormHandler.users[param:index].firstName"
     type="text"/>
     <dsp:input bean="MultiProfileAddFormHandler.users[param:index].lastName"
     type="text"/>
     <dsp:input bean="MultiProfileAddFormHandler.users[param:index].birthDate"
     type="text"/>
     <dsp:input bean="MultiProfileAddFormHandler.users[param:index].phoneNumber"
     type="text"/>
  </dsp:oparam>
</dsp:droplet>

Note: The number of user profiles in users is set by the form handler’s count and maxCount properties. The count property must be set in the handler before the form can be rendered. For more information, see the count property.