Changing page layout based on the user input

When a Visualforce form submission component specifies a rerender attribute, this causes a partial refresh of the page to take place, redrawing the specified components based on the result of the submission. This can be used to change the elements on the page based on the user input; for example, to guide the user through creating a record of a few fields at a time.

In this recipe, we will create a Visualforce page that allows the user to create an account record. If the user chooses an account type containing the word customer, additional fields will be rendered to capture additional customer-specific information.

Getting ready

This recipe makes use of a controller extension, so this needs to be present ...

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.