About Static Event Handlers

Deprecation Notice:

This feature is deprecated but will continue to work as expected. Switch to dynamic event handlers for current and future projects.

A static event handler relies on the static wiring of the element to a handler function. The event handler can't be dynamically added or modified at runtime.

Migrate from static to dynamic event handlers

To migrate a static event handler to a dynamic one:

  1. Open the Properties & Events panel for the element with the static event handler.
  2. Find the event you want to migrate and click the yellow lightning bolt icon next to the event handler name.
  3. Click the Migrate event link that appears.

After migration, your code updates from the old static format to the new dynamic format. For example:

Old format:

Copy

New format:

Copy

Delete a static event handler

You can no longer use the Properties & Events panel to delete static event handlers. To delete a static event handler, delete the generated code from the page code file.

See also

Did this help?