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
ajay ambatiajay ambati 

controller issue

can we have extensions in custom controllers?
Pankaj_GanwaniPankaj_Ganwani
Hi Ajay,

Yes, You can create as many controller's extensions as you want for your controller.

You can refer below mentioned link for this:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_extension.htm

I have just modified the code sample provided on above link:
 
<apex:page standardController="CustomCon" 
    extensions="ExtOne,ExtTwo" showHeader="false">
    <apex:outputText value="{!foo}" />
</apex:page>

public class ExtOne {
    public ExtOne(CustomCon acon) { }

    public String getFoo() {
        return 'foo-One';
    }
}

public class ExtOne {
    public ExtOne(CustomCon acon) { }

    public String getFoo() {
        return 'foo-One';
    }
}

 
JeffreyStevensJeffreyStevens
He was asking if you could have multiple extensions with CUSTOM CONTROLLERS.  So the page tag would have controller="CustomCon".  But I THINK the answer is the same.  Yes - you can have as many extensions as you want - even for custom controllers.
Abhijeet Anand 6Abhijeet Anand 6
Yes, we can.

<apex:page controller="ShowApexController" extensions="UserDetails,ProfieDetails" sideBar="true" tabStyle="Account" standardStylesheets="false" readOnly="true">