You need to sign in to do that
Don't have an account?
Kaity
Controller and Extensions:
Hi,
Can some one help me on this by explaining the reasons:
Given the following Force.com page markup and assuming the controller and each extension include an action method named “go,” which class method will be invoked when the user clicks on the commandButton?
A. theController
B. ext1
C. ext2
D. ext3
-Kaity
controller method is invoked,If same method is not there in controller then It will go to extension.
For your reference...
Multiple controller extensions can be defined for a single page through a comma-separated list. This allows for overrides of methods with the same name. For example, if the following page exists:
with the following extensions:
The value of the<apex:outputText>component renders asfoo-One. Overrides are defined by whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list. Thus, thegetFoomethod ofExtOneis overriding the method ofExtTwo.
All Answers
controller method is invoked,If same method is not there in controller then It will go to extension.
For your reference...
Multiple controller extensions can be defined for a single page through a comma-separated list. This allows for overrides of methods with the same name. For example, if the following page exists:
with the following extensions:
The value of the<apex:outputText>component renders asfoo-One. Overrides are defined by whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list. Thus, thegetFoomethod ofExtOneis overriding the method ofExtTwo.
Nice analysis. True Mentor!
What is the maximum limit of using extensions? I've used 7, but Apex runEngine didn't throw any error?
-Kaity
There is no such limit exists, you can use any number or extension but controller should be one.
The VF markup documented on that page is:
[code]
<apex:page controller="theController" extensions="ext1, ext2, ext3">
<apex:form>
<apex:commandButton value="Go" action="{!go}" rerender="out" />
<apex:outputPanel id="out">{!output}</apex:outputPanel>
</apex:form>
</apex:page>
[/code]
The sfdc.com page states that B is the correct answer, but I can't tell why... who is right? This thread or the SFDC public page? If the SFDC public page, why?