# Application Event Types Editor

## Overview

<div align="left"><figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-3bf99ff7ade23a4865bf0fa094ef17d6d4af86b6%2Fedit-add-event-types-demo-v2.gif?alt=media" alt=""><figcaption><p>Application Event Types Editor</p></figcaption></figure></div>

The **Application Event Types** property allows developers to define and configure custom application-level events that can be triggered and handled throughout the solution. This provides a way to centralize and standardize custom event names, signatures, and documentation.

These events are programmatically referenced using the [eventsManager](https://docs.servoy.com/servoycore/dev-api/events-manager#events-manager) API or similar mechanisms, making the solution more maintainable and consistent.

## Accessing the Editor

1. In the [Solution Explorer](https://docs.servoy.com/reference/solution-explorer#solution-explorer), click on the solution name (e.g., `mySolutionLess`).
2. In the **Properties view**, find the [eventTypes](https://docs.servoy.com/servoycore/object-model/solution#eventtypes) property.
3. Click on the property's value field to open the [Application Event Types Editor](#overview).

## Sections: Editor Structure

### Event Type List (Left Panel)

* Displays all defined custom event types in a vertical list.
* Each event is identified by its unique name.
* The list also shows a small **Delete icon** next to each event, allowing quick removal.

### Event Type Signature Properties (Right Panel)

When an event type is selected from the left panel, the right side shows its configurable signature properties:

* **UI Event**
  * A dropdown to optionally classify the event in relation to UI contexts (e.g., `Form`).
* **Description**
  * A multi-line text area for documenting the purpose, intended use, or behavior of the event.
* **Return Type**
  * A dropdown to optionally specify the return type of handlers for this event.
  * A small adjacent field to further describe what the return type means.
* **Arguments**
  * Displays a list of arguments that the event will pass when fired. Each row shows:
    * **Name**: The argument name.
    * **Type**: The argument type (e.g., `JSEvent`).
    * Includes an `Add Argument` button below to add new arguments.

## Sections: Buttons and UI Elements

### Per-Event Buttons

* 🗑️ **Delete**: Appears next to each event type in the left panel. Removes the selected event from the list.

### Global Buttons

* **Add New Event Type**: Opens a dialog to create a new event type by specifying its name.
  * **Event Name**: Text input for the new event's identifier.
  * **OK**: Confirms and adds the new event type.
  * **Cancel**: Closes the dialog without adding.
* **OK** (footer of the editor): Saves all changes and closes the editor.
* **Cancel** (footer of the editor): Discards any unsaved changes and closes the editor.

## Using the Application Event Types Editor

Here are the steps for using the **Application Event Types Editor**:

1. **Open the Event Types Editor**
   * Go to the [Solution Explorer](https://docs.servoy.com/reference/solution-explorer#solution-explorer).
   * Click your solution name and locate the [eventTypes](https://docs.servoy.com/servoycore/object-model/solution#eventtypes) property in the Properties view.
   * Click the property's value field to open the editor.
2. **Add a New Event Type**
   * Click `Add New Event Type` button.
   * Enter a unique event name in the prompt.
   * Click `OK`. The new event appears in the list.
3. **Configure Event Signature Properties**
   * Select an event in the left panel to edit its details on the right.
   * Choose a `UI Event` type from the dropdown if applicable.
   * Fill in the `Description` to explain the purpose of the event.
   * Select a `Return Type` from the dropdown and add a short explanation.
   * Click `Add Argument` button to define arguments that handlers will receive. Enter their `Name` and `Type`.
4. **Delete an Event**
   * Click the 🗑️ `Delete` icon next to the event you wish to remove.
5. **Save or Cancel**
   * Click `OK` to apply all changes and close the editor.
   * Click `Cancel` to discard any changes.
