Questions tagged [event-dispatching]

105 questions
46
votes
0 answers

Publisher-subscriber vs Observer

I am trying to make sense of Observer design pattern as the main event dispatching design pattern. The Observer pattern appears to be type or kind of Publish-Subscribe design pattern and I am wondering why there are two, similar looking design…
21
votes
4 answers

How to dispatch events in C#

I wish to create own events and dispatch them. I never done this before in C#, only in Flex.. I guess there must be a lot of differencies. Can anyone provide me a good example?
Janov Byrnisson
  • 255
  • 1
  • 3
  • 9
14
votes
6 answers

How to temporarily disable event listeners in Swing?

I've got a Swing application with a model and a view. In the view (GUI) there are a lot of components, each of them mapping to some property of a model object and displaying it's value. Now there are some UI components that automatically trigger the…
MicSim
  • 26,265
  • 16
  • 90
  • 133
12
votes
2 answers

What are the differences between EventEmitter, EventTarget and EventDispatcher

I'm trying to learn implementations of Observer Pattern. EventEmitter/EventTarget/EventDispatcher are one implementation of Observer Pattern but I wonder the differences between these three. Any help would be appreciated?
uzay95
  • 16,052
  • 31
  • 116
  • 182
10
votes
3 answers

HTML5 Drag and Drop ondragover not firing in Chrome

I have this simple example here which is not firing in Chrome 11 for me http://jsfiddle.net/G9mJw/ which consists on a very simple code: var dropzone = document.getElementById('dropzone'), draggable =…
zanona
  • 12,345
  • 25
  • 86
  • 141
9
votes
1 answer

Symfony Doctrine event subscriber not listed in debug:event-dispatcher

Symfony v3.3.4, Doctrine ORM v2.5.6 I've created an event subscriber for a doctrine entity : AppBundle\EventListener\LivreSubscriber: tags: - { name: doctrine.event_subscriber } It works fine ! But for a long time I tought it didn't…
kondor
  • 783
  • 1
  • 8
  • 22
7
votes
4 answers

What's the best way to integrate an event-dispatcher in a PHP library?

I need to integrate an event dispatcher in my own codebase (custom PHP library), so I looked at what both Symfony2 and Zend Framework 2 are doing. Obviously, there's no shared interface for dispatching events, because both frameworks have different…
odino
  • 1,069
  • 11
  • 27
7
votes
1 answer

Why does Symfony EventDispatcher use arbitrary names for events instead of class-based propagation?

I'm looking to implement Observer Pattern into my app (not php, that's why not using Symfony's component). I found it strange though that the component is not using classes to propagate or listen to events since that would allow listening on whole…
6
votes
3 answers

Reusable Javascript event object

I am making mouse click events and I'm trying to dispatch it to some node several times in a row. For that I am using the same MouseEvent object and for some reason this approach does not work. Yet, when I create event manually each time, system…
zpavlinovic
  • 1,507
  • 1
  • 17
  • 36
6
votes
3 answers

Reliable Webhook dispatching system

I am having a hard time figuring out a reliable and scalable solution for a webhook dispatch system. The current system uses RabbitMQ with a queue for webhooks (let's call it events), which are consumed and dispatched. This system worked for some…
Arthur
  • 1,433
  • 1
  • 18
  • 35
6
votes
1 answer

Dispatching drag-end event

I want to programmatically fire the "end" event of d3-drag. I have some circles and have the drag-handling of them implemented like so: ... .call(d3.drag() .on("drag", function () {...}) .on("end", function () {...}) ) Now, later in my…
Jonas
  • 135
  • 9
6
votes
2 answers

Updating swing components correctly?

I'm new to swing, any help appreciated. In this piece of code I'm turning a card over face up, if it turns out that they don't match I want them to turn back face down again. At the moment what is happening: 1. when clicked the first card turns over…
Ron
  • 129
  • 2
  • 8
4
votes
2 answers

Easier Custom Events Handling in Java

In Java, everytime I want to create a new custom event, I usually do it by add 3 methods namely: addDogEventListener(EventListener listener); removeDogEventListener(EventListener listener); dispatchDogEventListener(DogEvent event); Then now if I…
Carven
  • 14,988
  • 29
  • 118
  • 161
4
votes
1 answer

Chrome doesn't fire click event for SVG element (Firefox does)

I observe inconsistency/bug in handling click event among various browsers (Chrome, Edge, Firefox). In my JavaScript library that uses SVG I create clickable and draggable rectangles. When I run my snippet in Chrome browser the click event is not…
4
votes
1 answer

Cell: how to activate a contextMenu by keyboard?

A cell contextMenu can't be activated by keyboard: it's underlying reason being that the contextMenuEvent is dispatched to the focused node - which is the containing table, not the cell. The bug evaluation by Jonathan has an outline of how solve…
kleopatra
  • 51,061
  • 28
  • 99
  • 211
1
2 3 4 5 6 7