Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Excerpt

Extend this class to create your own handlers that react to events on the form.

To add your own event handlers, first create your own class which extends B25.FormEventHandler. Then, inside the customize method (as defined in the B25.Form.Customizer interface), you can bind an instance of your class to an action on the form.

To extend this class, you must override the handleEvent method. Inside the handleEvent method you can then add your own logic to respond to events and manipulate the contents of the form.

Example

Code Block
global with sharing class MyEventHandler extends B25.FormEventHandler {
    global override void handleEvent(B25.FormEvent event, B25.Form form) {
        form.getField(B25__Reservation__c.B25__Title__c).updateValue('Hello World!');
    }
}

Methods

handleEvent

Code Block
abstract void handleEvent(B25.FormEvent event, B25.Form form)

This method must be overriden overridden in your own event handlers. Inside this method, you can inspect the event (as well as the current state of the form) and react to it by manipulating the form.

Parameters:

Name

Type

Description

event

B25.FormEvent

The event that your handler is responding to.

form

B25.Form

The form, which you can manipulate.


getHandlerName

Code Block
String getHandlerName()

Returns the name of this handler. All default handlers that have been added by Booker25 have a descriptive name, which allows you to recognize them. This is useful if you want to disable specific handlers defined by Booker25.

Return value: String

On this page

Table of Contents