22.3. Registration of the event classes

Database and Navigation event factories automatically register the default event classes into the system. Developers can register additional event classes by declaring and configuring elements into the dbforms-config file, as shown in the example below:

  <dbforms-config>

    <!-- dbforms config stuff here... -->
    <!-- define custom events -->            

    <events>        

      <!-- define database custom events here -->               
      <database-events>1
        <database-event id="insert2" type="insert" className="org.foo.bar.MyInsertEvent" /> 
        <database-event id="update2" type="update" className="org.foo.bar.MyUpdateEvent" /> 
      </database-events>

      <!-- define navigation custom events here -->
      <navigation-events>2  
        <navigation-event id="new2" type="navNew"   className="org.foo.bar.MyNavNewEvent" />
      </navigation-events>

    </events>  
  </dbforms-config>    
      
1

To add database custom events, a developer must:

  • add a new /dbforms-config/events/database-events element, if it does not exist yet

  • add a new /dbforms-config/events/database-events/database-event element for every database custom event to register into the system

2

To add navigation custom events, a developer must:

  • add a new /dbforms-config/events/navigation-events element, if it does not exist yet

  • add a new /dbforms-config/events/navigation-events/navigation-event element for every navigation custom event to register into the system

22.3.1. Event attributes

Every database-event element and navigation-event element uses the following mandatory attributes:

attribute namedescription
idthe event identifier. Must be unique.
typethe event type. Must be a supported type value.
classNamethe full qualified class name of the event class.