Event Handling

Table of Contents

Naming of Events
The Recite Delegate Element
Triggering Events
Listening For Delegate Events
Listening For Other Events
Automatically Triggered Events

The Recite Control Panel is an event-driven system. In other words, widgets will respond to certain things happening.

Let's use the File Import widget as an example:

  1. User selects a file to upload then begins the upload. Trigger an event that an "Uploading" status message should be shown.

  2. File continues to upload. Listen for an event that indicates how much has been uploaded and update the display accordingly.

  3. File completes uploading. Trigger an event that the "Uploading" status message should no longer be shown.

  4. Receive confirmation from server that file is uploaded. "File Browser" widget listens for this event. Refreshes its display so the newly uploaded file is displayed.

You can trigger your own events and listen for events accordingly.

Naming of Events

Events are named in the format eventName.nameSpace. The namespace is determined by what triggers the event. Events triggered by modules are named module_moduleName.

Let's return to the previous file upload example to demonstrate this. When a file is uploaded, the server sends back the following event: filecreated.module_assets.