Using Standard List Controller Actions

Action methods perform logic or navigation when a page event occurs, such as when a user clicks a button, or hovers over an area of the page. Action methods can be called from page markup by using {! } notation in the action parameter of one of the following tags:

The following table describes the action methods that are supported by all standard list controllers. You can associate these actions with any Visualforce component that includes an action attribute.
ActionDescription
saveInserts new records or updates existing records that have been changed. After this operation is finished, the save action returns the user to the original page, if known, or the home page.
quicksaveInserts new records or updates existing records that have been changed. Unlike the save action, quicksave does not redirect the user to another page.
listReturns a PageReference object of the standard list page, based on the most recently used list filter for that object when the filterId is not specified by the user.
cancelAborts an edit operation. After this operation is finished, the cancel action returns the user to the page where the user originally invoked the edit.
firstDisplays the first page of records in the set.
lastDisplays the last page of records in the set.
nextDisplays the next page of records in the set.
previousDisplays the previous page of records in the set.

In the following example, the user specifies a filter for viewing account records. When the user clicks Go, the standard list page displays, using the selected filter.

<apex:page standardController="Account" recordSetVar="accounts">
   <apex:form>
       <apex:selectList value="{!filterid}" size="1">
           <apex:selectOptions value="{!listviewoptions}"/>
       </apex:selectList>
       <apex:commandButton value="Go" action="{!list}"/>
   </apex:form>
</apex:page>
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.