event-handling

Why isn't preventDefault working for jQuery?

I can't seem to get preventDefault() to work with the following code... The browser still wants to jump to the top of the page after a click. Any ideas on how to fix this? $('#controls a').click(function(event){ event.preventDefault(); var r = $(this).attr('rel'); var c = $('#container').attr('class'); // Prevent redundant action...

Options Menu Cancel Event [Android]

Beginning with a basic approach -- Options Menu. Question: What is the best way to capture a cancel (return) event? I.e. the user changes their mind and hits the back arrow. The issue is that I would like to unpause my an application thread. @Override public boolean onCreateOptionsMenu(Menu menu) { onPause(); MenuInflater infla...

How to know what action is triggering an event?

Hi, How do I know what action is triggering a particular event? org.w3c.dom.events.EventListener refreshAnnotationsListener = new org.w3c.dom.events.EventListener() { @Override public void handleEvent(org.w3c.dom.events.Event event) { // how do I know the action which triggered this event? } }; I guess there is a ...

GWT adding Event Handler overrides the native one ?

Hi, lets say i have the following html element on my host page: <input type="text" onfocus="this.value = ''" id="textField"/> In gwt i wrap this into an TextBox Widget like this: final TextBox myTextBox = TextBox.wrap(DOM.getElementById("textField")); If i now want to add a focus handler what will happen? myTextBox.addFocusHandle...

Java KeyListener is giving me "Unknown keyCode:0x0"

class KeyDemoFrame extends JFrame implements KeyListener { String line1; KeyDemoFrame() { setTitle("hello"); setSize(200,200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); addKeyListener(this); } public void keyTyped(KeyEvent e) { line1 = e.getKeyT...

Java KeyListener is not working

I've just managed to get KeyListener to work in an empty application, but then I tried to implement it in my application and it simply doesn't work, no matter how much I enter keys! A friend told me it's because I have buttons (JButton) on the application (and I implement the actionPerformed method,) can anyone explain to me why this is...

How to fetch registry path from EventArrivedEventArgs object

I try to watch the registry events via WMI. I use the below query to watch any events inside HKLM\softwares WqlEventQuery query = new WqlEventQuery( "SELECT * FROM RegistryTreeChangeEvent WHERE " + "(Hive = 'HKEY_LOCAL_MACHINE')" + "AND Rootpath = 'Software'" As expected...

Enter-key Prevention Javascript Not Working for JSF 1.1 in IE

Notes on environment: JSF 1.1 using Infragistics component library. I'm using the following Javascript to attempt to prevent an 'Enter' keypress from submitting a form. function disableEnterKey(e){ var key; if(window.event) key = window.event.keyCode; else key = e.which; return (key !...

What is the standard approach for event handling in case of Visual Inheritance?

We know that when a Form is visually inherited, all of its controls are locked in design time. This problem requires that we place event handlers in the base form. Now what should I do if I want to place base-control event handlers in the derived Form? Since the controls are locked, approach of double clicking on the control to add an e...

EventDispatcher undefined in Flex 4 class

Hi all, My class in ActionScript works perfectly, it all it's job but my only concern is that I have a textfield binded to a getter property and although this initially works perfectly, whenever the property updates the value will not change on the textfield =( public function get XMLCollisions():String { var s:String = new String();...

SharePoint Document or Item Download/View Event Handler?

Hi, Is there any way to capture document download or item view actions in SharePoint 2010/2007? Thanks. ...

C# making an event wait

Hey, I'm working on some event-driven code. In one of the components of my system an event sometimes comes up that I have no handler for at the moment. Is there any way to make the event "wait" until a handler is available for it? Thanks, PM ...

how to write class lib's assembly load/init event handler

I am trying to convert Java libs to c# libs. I am stuck at a place and could not find any solution via googling. The issue is in c# Class Lib i want to write assembly load/init event handler, is it possible as in Java it seems is? In java the code is. public class abc implements ServletContextListener { public void contextInitialized(S...

Button Click Event Won't Return Value to Textbox

Hi, I have two buttons on my web form. When clicking on the first button, the event does not fire. Here's what I've placed in the click event handler: protected void btnRFC_Click(object sender, EventArgs e) { string strDOB = drpDay.SelectedValue + "/" + drpmonth.SelectedValue + "/" + txtyear.Text; string strRFC = CURPRFC.Calc...

Why is javascript sending an element to my event handler, when that element has no event?

This html: <span id="mySpan"><img src="images/picture.png" alt="Some nice alt text" /> Link text</span> This javascript takes the span containing the image and text, then makes it clickable: spanVar = document.getElementById("mySpan"); spanVar.addEventListener("click", myEvent, false); function myEvent(e){ var obj = e.target; } ...

How do you raise an event in C#?

An stock data download class has a BarList to which it either adds new bars or updates and replaces the last bar when the last bar changes realtime. Whenever this download class adds a new bar to the BarList class or changes its last bar, it also calls its NotifyOnBarsAdded or NotifyOnBarChanges. I'm trying to get the notify methods to r...

How to use WF4 activity to wait for an event?

I found that you can use Pick activity and this activity will contain a few PickBranches, each of which contains a Trigger and an Action. How do I tie the Trigger activity to any .NET event? for example, Timer.Tick event, Key pressed event, or perhaps my own event? ...

How to make Android Activities aware of some background communication over Bluetooth?

I am developing an application which exchanges some data over Bluetooth (RFCOMM channel). The app will consist of few Activities that all need to be aware of exchanged data (e.g. receive it, parse it, update Activity's screen and send a response or even fire another activity based on received data). So my question is: what Android featu...

Key event handlers don't fire at the form level

{Form constructor} this->KeyDown += gcnew KeyEventHandler(this, &Form::Form_KeyDown); ... void Form1::Form_KeyDown(Object^ Sender, KeyEventArgs^ E) { MessageBox::Show("Key = " + E->KeyCode.ToString(), "Test"); } The above event handler never fires. But the form's child controls' handler does. What would be the problem ? ...

Property 'CommandArgument' is WriteOnly

I have the following line in my code, inside the click event handler of an ImageButton: Protected Sub FinaliseBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FinaliseBtn.Click, SubmitPaymentViaChequeBtn.Click Dim str as String = sender.commandargument.ToString.ToLower End Sub Both Controls are ImageButton's. ...