Considerations for managing large component trees

Here are a few considerations when designing Visualforce pages utilizing tables or repeated sections that contain the native Visualforce components:

  • View state is only generated if you have an apex:form tag on the page; if you don't need one, then you should remove it, for example, in view-only pages.
  • Consider if you need to use Visualforce components such as apex:outputField, or if using HTML elements directly with a Visualforce expression would suffice. HTML elements consume no view state. However, be careful to consider localization features the standard components provide when doing this, such as formatting dates and numbers; you might need to perform this in the Apex code and bind to the formatted values.
  • Avoid nested apex:repeat tags that contain Visualforce components. If possible, flatten a nested structure with the Apex logic in your controller and expose a single iterable list property that results in the same output.
  • Consider moving to a stateless controller mode, as described in the following section.
  • Consider implementing pagination in your page.
For further analysis, search http://salesforce.stackexchange.com/ for How to reduce a large internal view state / what is in the internal view state?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.9.7