trigger.event {AnalysisPageServer} | R Documentation

## trigger.event

### Description

Trigger a registered Event

### Usage

    trigger.event(registry, event, ...)

### Arguments

`registry` | EventRegistry
`event` | Name of event to trigger
`...` | Further parameters are passed to each handler in turn.

### Details

Trigger a registered Event.

Every handler is called in turn. If any handler returns a value with a "CatchEvent" attribute set to TRUE then no further handlers are called. That attribute is removed from the return value and the value is returned to the triggering context. Otherwise the return value of only the last function is called.

If no handlers are registered then NULL is returned.

If no Event exists of that name then an error is thrown.

### Value

See Details

### Author(s)

Brad Friedman

### Examples

    r <- new.event.registry()
    add.event(r, "mouseclick")
    add.event.handler(r, "mouseclick", function(x, y)  message("Mouse clicked at coordinates (", x, ", ", y, ")"))
    trigger.event(r, "mouseclick", x = 30, y = 50)

[Package AnalysisPageServer version 1.14.0 Index]