Skip to main content
1 of 3
Tyager
  • 574
  • 8
  • 15

Visualforce page and Visualforce component

I am working on a project right new and I just noticed something, that makes sense, but I did not realize it.

The Visualforce page and the Visualforce component both use the same controller. Now correct me if I am wrong, but when the Visualforce component is called from the Visualforce page, the component will then instantiate the controller again.

This is essentially doubling the amount of SOQL depending on the code used. If what I am saying is correct, could you see a way to pass in a pointer to the component, from the page, that will indicate to use the already instantiated controller?

I'm looking for clarification to see if what I am saying is correct in this matter.

Tyager
  • 574
  • 8
  • 15