1.

How Many Controllers Can Be Used On Single Vf Page?

Answer»

Only one controller can be used salesforce. Other than them, Controller extension can be used.

There may be more than one Controller extension.

Example:

<APEX:page standardController="ACCOUNT"

extensions="ExtOne,ExtTwo" showHeader="false"&GT;

<apex:outputText value="{!foo}" />

</apex:page>

if ExtOne and ExtTwo, both have the method getFoo() then the method of ExtOne will be executed.

A controller extension is any Apex class that contains a constructor that TAKES a single argument of typeApexPages.StandardController or CustomControllerName, where CustomControllerName is the name of a custom controller that you want to extend.

Only one controller can be used salesforce. Other than them, Controller extension can be used.

There may be more than one Controller extension.

Example:

<apex:page standardController="Account"

extensions="ExtOne,ExtTwo" showHeader="false">

<apex:outputText value="{!foo}" />

</apex:page>

if ExtOne and ExtTwo, both have the method getFoo() then the method of ExtOne will be executed.

A controller extension is any Apex class that contains a constructor that takes a single argument of typeApexPages.StandardController or CustomControllerName, where CustomControllerName is the name of a custom controller that you want to extend.



Discussion

No Comment Found