[UP]
Reference
 Dialogs
 Data types
 Events
 Events (O'Caml)
 Events (Perl)
 Templates
 Session management and security
 Internationalization
 Output encodings
 Processing instructions
 The UI language
 The standard UI library
 WDialog API (O'Caml)
 Runtime models
   
Events

From an abstract point of view, when an event is triggered an event description is sent to the current dialog object which can react on it. In reality, the process is much more complicated; the WWW browser triggers the event which causes that a HTML form is sent to the server. The server decodes the form, reconstructs the current dialog, analyzes which event has happened, and finally invokes the event handling method of the dialog object.

The following elements can trigger events when the user clicks the interactors they create:

  • The button element with "name", without "index":

    <ui:button name="n" ...>
    

    This type of event is called button event; the only parameter of such an event is the name of the button.

  • The button element with "name" and "index":

    <ui:button name="n" index="x" ...>
    

    This type of event is called indexed button event; the parameters are the name of the button and the index value.

  • The imagebutton element with "name", without "index":

    <ui:imagebutton name="n" ...>
    

    This type of event is called imagebutton event; the parameters are the name of the button and the coordinates of the click.

  • The imagebutton element with "name" and "index":

    <ui:imagebutton name="n" index="x" ...>
    

    This type of event is called indexed imagebutton event; the parameters are the name of the button, the index value, and the coordinates of the click.

  • The anchor element with "name", without "index":

    <ui:a name="n" ...>
    

    This type of event is called hyperlink event; the only parameter of such an event is the name of the anchor.

  • The anchor element with "name" and "index":

    <ui:a name="n" index="x" ...>
    

    This type of event is called indexed hyperlink event; the parameters are the name of the anchor and the index value.

Besides the events resulting from interactors, there are two additional events:

  • When a server popup window has been opened, a popup request is triggered; it normally causes that the popup page is generated and displayed in the new window.

  • Of course, it is possible that the browser submits the HTML form because of a Javascript statement[1]. In this case, the null event is generated (which may actually be a real event that does not fall into one of the event categories).

As already explained, the system reconstructs the dialog object that was active when the current page was generated. Furthermore, the variables are updated which are tied to interactors, i.e. the variables reflect the values as they have been edited by the user.

Handling events

In order to catch an event, one must define/override the handle method of the dialog class. Please see the language-specific interface descriptions for further details.

Actions

In principle, there are three different actions that may happen as a consequence of an event:

  • The dialog sets its instance variables to different values, and generates the same page for the new values of variables.

  • The dialog sets the instance variables, but changes the page to display.

  • The dialog switches to a second dialog, and asks it to generate the next page.


[1]
E.g. by executing document.uiform.submit()