Reducing view state size 2 - HTML vs Visualforce components

Visualforce components contribute to the internal element of the view state. A page with a large number of components, or with a repeating element that contains a number of components, may consume a significant amount of the view state.

In this recipe we will create two Visualforce pages:

  • The first will iterate a collection of opportunity records using an <apex:pageBlockTable /> repeater component with nested standard components for columns and input fields
  • The second will iterate a collection of opportunity records using a regular HTML <table> element

We will then use the View State Inspector to examine the overall size and contents of the view state for each page to see the impact that ...

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.