function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael3.BrownMichael3.Brown 

How can I call an additional Controller

Hello,

 

I was hoping to find out how I can call an additional controller on my VF page.

 

Is thre a setting I can use in the <apex:page> tags?

I tried

<apex:page controller="Controller 1">

*code

</apex:page>

 

<apex:page controlller="Conroller 2>

** code

</apex>

 

But, I was gettin errors in doing this.

 

Thanks,

Mike

Best Answer chosen by Admin (Salesforce Developers) 
joshbirkjoshbirk

You can add an extension to your Visualforce page, and the page will acknowledge the controller (standard or custom) as well as the extension's code.

 

In the page tag, it's "extensions" and you refer to it the same the same way, but the constructor is slightly different in Apex.  You can read more about them in the docs here:

 

www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm

 

Is that the kind of functionality you were looking for?

All Answers

joshbirkjoshbirk

You can add an extension to your Visualforce page, and the page will acknowledge the controller (standard or custom) as well as the extension's code.

 

In the page tag, it's "extensions" and you refer to it the same the same way, but the constructor is slightly different in Apex.  You can read more about them in the docs here:

 

www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm

 

Is that the kind of functionality you were looking for?

This was selected as the best answer
Michael3.BrownMichael3.Brown

Thanks Josh! I was able to get it working through the extensions.