The custom iterator component

The Visualforce standard component <apex:repeat /> iterates a collection of data and outputs the contained markup once for each element in the collection. In the scenario where this is being used to display a table of data, the markup for the table headings appears before the <apex:repeat /> component and is rendered regardless of whether the collection contains any records or not.

Custom iterator components may contain additional markup to be rendered outside the collection, for example, the headings markup in the scenario mentioned earlier. This allows the component to avoid rendering any markup if the collection is empty through the logic implemented in a custom controller.

In this recipe, we will create a custom ...

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.