Event handling is a coding style about handling messages between a source and one or more subscribers. A point listener in the source provide a way which subscribed code can consume messages raised from the source.
Questions tagged [event-handling]
12746 questions
132
votes
5 answers
Explain ExtJS 4 event handling
I've recently started learning ExtJS, and have trouble understanding how to handle Events. I have no experience of any previous versions of ExtJS.
From reading various manuals, guides and documentation pages, I've figured out how to use it, but I'm…

jrharshath
- 25,975
- 33
- 97
- 127
131
votes
2 answers
Pass parameter to EventHandler
I have the following EventHandler to which I added a parameter MusicNote music:
public void PlayMusicEvent(object sender, EventArgs e,MusicNote music)
{
music.player.Stop();
System.Timers.Timer myTimer = (System.Timers.Timer)sender;
…

Matt
- 3,820
- 16
- 50
- 73
129
votes
18 answers
How can I change the EditText text without triggering the Text Watcher?
I have an EditText field with a Customer Text Watcher on it. In a piece of code I need to change the value in the EditText which I do using .setText("whatever").
The problem is as soon as I make that change the afterTextChanged method gets called…

user1143767
- 1,461
- 2
- 13
- 13
126
votes
9 answers
Javascript event handler with parameters
I want to make an eventHandler that passes the event and some parameters. The problem is that the function doesn't get the element. Here is an example:
doClick = function(func){
var elem = .. // the element where it is all about
elem.onclick…

sebas2day
- 2,013
- 2
- 15
- 14
125
votes
2 answers
Is it necessary to explicitly remove event handlers in C#
I have a class that offers up a few events. That class is declared globally but not instanced upon that global declaration--it's instanced on an as-needed basis in the methods that need it.
Each time that class is needed in a method, it is…

rp.
- 17,483
- 12
- 63
- 79
120
votes
6 answers
How to trigger event when a variable's value is changed?
I'm currently creating an application in C# using Visual Studio. I want to create some code so that when a variable has a value of 1 then a certain piece of code is carried out.
I know that I can use an if statement but the problem is that the value…

James Mundy
- 4,180
- 6
- 35
- 58
119
votes
6 answers
Get clicked element using jQuery on event?
I'm using the following code to detect when a dynamically generated button is clicked.
$(document).on("click",".appDetails", function () {
alert("test");
});
Normally, if you just did $('.appDetails').click() you could use $(this) to get the…
user736893
118
votes
2 answers
JavaScript: Listen for attribute change?
Is it possible in JavaScript to listen for a change of attribute value? For example:
var element=document.querySelector('…');
element.addEventListener( ? ,doit,false);
element.setAttribute('something','whatever');
function doit() {
}
I would…

Manngo
- 14,066
- 10
- 88
- 110
118
votes
8 answers
How to remove "onclick" with JQuery?
PHP code:
Qualify
I want to remove the onclick="check($id,1) so the link cannot be clicked or "check($id,1) won't be fired. How can I do it with JQuery?

Steven
- 24,410
- 42
- 108
- 130
116
votes
8 answers
jQuery: $().click(fn) vs. $().bind('click',fn);
When using jQuery to hookup an event handler, is there any difference between using the click method
$().click(fn)
versus using the bind method
$().bind('click',fn);
Other than bind's optional data parameter.

Alana Storm
- 164,128
- 91
- 395
- 599
116
votes
14 answers
Put length constraint in a TextField in react js
I am taking an input from the user of the card number and wants that the length entered by user must not be less than and more than 12. Here is the declaration of my textfield.

Mayank Bansal
- 1,755
- 2
- 9
- 22
112
votes
9 answers
C# pattern to prevent an event handler hooked twice
Duplicate of: How to ensure an event is only subscribed to once
and Has an event handler already been added?
I have a singleton that provides some service and my classes hook into some events on it, sometimes a class is hooking twice to the event…

Ali Shafai
- 5,141
- 8
- 34
- 50
112
votes
8 answers
When should I use jQuery's document.ready function?
I was told to use document.ready when I first started to use Javascript/jQuery but I never really learned why.
Might someone provide some basic guidelines on when it makes sense to wrap javascript/jquery code inside jQuery's document.ready?
Some…

tim peterson
- 23,653
- 59
- 177
- 299
111
votes
13 answers
Order of event handler execution
If I set up multiple event handlers, like so:
_webservice.RetrieveDataCompleted += ProcessData1;
_webservice.RetrieveDataCompleted += ProcessData2;
what order are the handlers run when the event RetrieveDataCompleted is fired? Are they run in the…

Phillip Ngan
- 15,482
- 8
- 63
- 79
105
votes
7 answers
Changing UIButton text
So I'm trying to update the text on a UIButton when I click it. I'm using the following line to change the text:
calibrationButton.titleLabel.text = @"Calibration";
I have verified that the text is changing, but when I run the app and I click on…

Julian Coltea
- 3,599
- 10
- 26
- 32