Ticket #1189 (closed feature: fixed)
allow triggerEvent to be called with additional arguments for the listener
| Reported by: | tschaub | Owned by: | euzuro |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.6 Release |
| Component: | Events | Version: | 2.5 |
| Keywords: | Cc: | ||
| State: |
Description
Our triggerEvent method just calls all listeners (optionally bound to some caller). This can be modified easily to call listeners with additional arguments. This makes event stuff more fun.
Pretend a drag feature control wanted to trigger a "predragfeature" event on a layer. Listeners should expect to receive the feature in question and perhaps the start and end pixel (of the drag). In addition, if triggerEvent returns the return from the last listener, then that control can modify its behavior (undo the drag for example) if the arguments (start and end pixel in this case) don't meet some user specified criteria.
Just a mocked up example, but this would give us way more flexibility with our event magic. Basically, I'm asking for triggerEvent to take an optional third argument and return continueChain.

