ApexPages
For example, you could create a saveOver method on a controller extension that performs a custom save.
ApexPages.Action saveAction = new ApexPages.Action('{!save}');
In the following example, when the user updates or creates a new Account and clicks the Save button, in addition to the account being updated or created, the system writes a message to the system debug log. This example extends the standard controller for Account.
public class pageCon{ public PageReference RedirectToStep2(){ // ... // ... return Page.Step2; } }
<apex:component> <apex:attribute name="actionToInvoke" type="ApexPages.Action" ... /> ... <apex:commandButton value="Perform Controller Action" action="{!actionToInvoke}"/> </apex:component> <apex:page controller="pageCon"> ... <c:myComp actionToInvoke="{!RedirectToStep2}"/> </apex:page>