Chapter 2. Custom Components

In this chapter, we will cover the following recipes:

  • Passing attributes to components
  • Updating attributes in component controllers
  • Passing action methods to components
  • Data-driven decimal places
  • The custom iterator component
  • Setting a value into a controller property
  • Multiselecting related objects
  • Notifying the containing page controller

Introduction

Custom components allow custom Visualforce functionality to be encapsulated as discrete modules, which provide two main benefits:

  1. Functional decomposition: where a lengthy page is broken down into custom components to make it easier to develop and maintain.
  2. Code reuse: where a custom component provides common functionality that can be reused across a number of pages.

A custom component ...

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.