You need to sign in to do that
Don't have an account?
QuickDEV
command button invoking controller method
Hi,
Can I call a method present in the extension class onclick of a command button.
Or should that method be present in the standard or custom controller.
Thanks.
You would need to set up an ActionFunction for the method you wish to call, and invoke that via JavaScript from the onclick event.
That said, a command button already takes an attribute of the method you want to invoke when the user presses it - can you not use that?
An example of Bob's second statement:
<apex:commandButton value="Search" action="{!Search}"/>
Thank you both for the replies.
what if the {!search} method is an extension class but not either in standard or custom controller?
Thanks
An extension allows you to add methods to another controller. The methods in the extension are seen as if they are in the controller.