Action Class

You can use ApexPages.Action to create an action method that you can use in a Visualforce custom controller or controller extension.

ApexPages

For example, you could create a saveOver method on a controller extension that performs a custom save.

The following code snippet illustrates how to instantiate a new ApexPages.Action object that uses the save action:

The following are constructors for Action.

  • Action(action)

    Creates a new instance of the ApexPages.Action class using the specified action.

Creates a new instance of the ApexPages.Action class using the specified action.

public Action(String action)

  • action: Type: String The action.

The following are methods for Action. All are instance methods.

  • getExpression()

    Returns the expression that is evaluated when the action is invoked.

  • invoke()

    Invokes the action.

Returns the expression that is evaluated when the action is invoked.

public String getExpression()

Type: String

Invokes the action.

public System.PageReference invoke()

Type: System.PageReference