Changing options based on the user input

In the earlier recipes, for example, Retrieving fields when a lookup is populated in Chapter 3, Capturing Data Using Forms, we have seen how to populate the contents of fields in response to user actions. This technique can also be used to change the characteristics of other input fields on the page in response to user selections.

In this recipe, we will create a Visualforce page that allows a user to create five task sObject records at once. Each task is associated with a contact selected from a picklist. The picklist options are configured through a series of checkboxes; clearing a checkbox removes the contact from the picklist.

Getting ready

This recipe makes use of a custom controller, so this will need ...

Get Visualforce Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.