# Namespace: Actions

## Core. Actions

The namespace for anything to do with PDF actions and action dispatch. Actions can be defined by providing a JavaScript object that has the desired properties, and a name property defining the action subtype it represents. See documentation for specific action types for allowable properties.

### Classes

Action
Dest
GoTo
GoToR
Hide
JavaScript
Named
ResetForm
SubmitForm
URI

### Mixins

Dispatcher

### Members

#### <static> OnTriggeredAdditionalOptions

  Additional options passed to the onTriggered handler.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `originalOnTriggered` | Core.Actions.ActionOnTriggeredHandler | The original onTriggered function of this action
  `action` | Core.Actions.Action | The action that is being triggered

### Methods

#### <static> setCustomOnTriggeredHandler(actionClass, onTriggeredHandler)

  Sets a custom handler function that will be called when an action of the specified type is triggered.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `actionClass` | Core.Actions.Action | The class (constructor) of the action
  `onTriggeredHandler` | Core.Actions.CustomActionOnTriggeredHandler | A handler function that will be called when the an action of the specified type is triggered

  ##### Example

      Actions.setCustomOnTriggeredHandler(Actions.URI, (target, event, documentViewer, options) => {
         if (target instanceof Annotations.Link) {
         // Don't do anything if the action is triggered by a link
           return;
         }
         options.originalOnTriggered(target, event, documentViewer)
      });

### Type Definitions

#### ActionOnTriggeredHandler(target, event, documentViewer)

  The onTriggered function for actions.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `target` | Core.Annotations.Forms.Field | Core.DocumentViewer | The dispatcher to which this action is attached
  `event` | object | The embedded JS event that is used when executing the action
  `documentViewer` | Core.DocumentViewer | The DocumentViewer to use as context for the action execution

#### CustomActionOnTriggeredHandler(target, event, documentViewer, options)

  Handler function that gets passed to Core.Actions.setCustomOnTriggeredHandler. The signature is similar to onTriggered except with an additional options parameter.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `target` | Core.Annotations.Forms.Field | Core.DocumentViewer | The object that the action has been triggered on
  `event` | object | The embedded JS event that is used when executing the action
  `documentViewer` | Core.DocumentViewer | The DocumentViewer to use as context for the action execution
  `options` | Core.Actions.OnTriggeredAdditionalOptions | Additional options and parameters ###### Properties
  Name | Type | Description
  --- | --- | ---
  `action` | Core.Actions.Action | The action object that is being triggered
  `originalOnTriggered` | Core.Actions.ActionOnTriggeredHandler | The original onTriggered function of this action

#### Search results