events

jQuery problem with change event and IE8

There is a bug in jQuery 1.4.2 that makes change event on select-element getting fired twice when using both DOM-event and a jQuery event, and this only on IE7/8. Here is the test code: <html> <head> <script src="http://code.jquery.com/jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript"> jQ...

jQuery event.layerX/Y is not relative to the element that triggered the event, is that correct?

If I use for example a mousemove event handler on a div and check the layerX property of the event, it changes when my mouse enters a positioned element inside that div (like an image). According to the jQuery Event object documentation it should follow the W3C DOM Level 3 specifications. But there's no mention of the layerX/Y property...

Override OnClose()

I got this class class CWebBrowser2 : public CWnd And i want to override OnClose What i have done so far is in the header file I added void OnClose(); and in the .cpp file i added void CWebBrowser2::OnClose () { int i=0; i++; } But the OnClose is never called. Then I tried to to modify the header file to afx_msg...

Paste Event in a WPF TextBox

I have created a custom control inheriting TextBox. This custom control is a numeric TextBox, only supporting numbers. I am using OnPreviewTextInput to check each new character being typed to see if the character is a valid input. This works great. However, if I paste the text into the TextBox, OnPreviewTextInput is not fired. What is ...

Calling private event handler from outside class

i've two classes. One class (say A) takes a textbox in c'tor. and registers TextChanged event with private event-handler method. 2nd class (say B) creates the object of class A by providing a textbox. how to invoke the private event handler of class A from class B? it also registers the MouseClick event. is there any way to invoke pr...

Asp.Net form validation onkeyup

Hi all, I rewrote the standard asp.net validation javascript so some (css)classes will be set either a validator is true or false. This javascript is triggered on the "onchange" (standard asp.net behavior event but I would like that this javascript is triggered "onkeyup" Is there a way so change this? ...

C# Get Events of a Control inside a Custom Control

I have a listbox inside a custom control. I use this custom control into a form. I would like to be able to get the listbox index changed event when I am working into the form. How can I do that? ...

How can I get jquery .val() AFTER keypress event?

I got: $(someTextInputField).keypress(function() { alert($(this).val()); }); Now the alert always returns the value BEFORE the keypress (e.g. the field is empty, I type 'a' and the alert gives me ''. Then I type 'b' and the alert gives me 'a'...). But I want the value AFTER the keypress - how can I do that? Background: I'd like to ...

creating events in my classes, and allowing others to hook into them in my django app

I want to create events for my classes. Say I create a CMS application that has a Article object. I create events like: OnEdit OnCreate OnDelete PreCreate PreDelete Now I want someone to be able to hook into these events, and add their custom functionality at each event they wish. I don't want them touching the core source code, so...

Why would a 'public event EventHandler cccc' be null?

Why would a 'public event EventHandler cccc' be null? I have a class that's public class Builder { public event EventHandler StartedWorking; public Builder() { // Constructor does some stuff } public void Start() { StartedWorking(this, eventargobject); //StartedWorking is null -- } } ...

Use event and delegate in subclass

Why cant i use the event declared in Base from Sub? class Program { static void Main(string[] args) { Sub sub = new Sub(); sub.log += new Base.logEvent(sub_log); sub.go(); } static void sub_log(string message, int level) { Console.Out.WriteLine(message + " " + level); } } public ...

Is there an Javascript event for when a the page is pushed into the background?

I remember having used such an event, but I can't remember the name. The specific task I'm trying to accomplish is to stop my slideshow when the browser window isn't in the foreground. I'm fading the different images with jQuery, which uses quite some CPU power. Is there an event that tells me, when the user switches to another applica...

How do you add a key handler to a GWT FlexTable?

I'm trying to change the row highlighting in my FlexTable using KeyCodes.KEY_UP/DOWN. This doesn't seem to work (based on 1809155): public class KeyAwareFlexTable extends FlexTable implements KeyDownHandler, HasKeyDownHandlers { public KeyAwareFlexTable() { this.addKeyDownHandler(this); } @Override public void ...

HTML where will the focus go next if I press tab?

Hi all, Is there some way of knowing where will the focus jump to when the tab key key will be pressed and certain element has the focus? I am thinking on something to be used this way: var nextElement = whereWillFocusJumpTo(currentElement); Thanks! ...

Button click event not firing in second view of a viewflipper

I have a layout in xml that, when the user clicks a "next" button I inflate, populate with the next screen's data, and create and set the onclicklistener for an imagebutton in the new view. I then add this view to my main ViewFlipper and call showNext() on it. The view slides into place and the button is there but there are problems: ...

How to change a field value during the ItemUpdating event

Hi I am trying to set the value of a field on a ListItem in an event receiver but its not working All i am doing during the event is properties.AfterProperties[<field internal name>] = 1; No errors are thrown but the the field i'm setting does not change. I have also tried properties.ListItem[<field internal name>] = 1; properties...

Failed to load viewstate

OK have just started getting this error and I'm not sure why. I have a hosting page which has listview and a panel with a usercontrol. The listview loads up records with a linkbutton. You click the link button to edit that particular record - which gets loaded up in the formview (within the usercontrol) which goes to edit mode. After...

Raising an event on parent window from a user control in .NET C#

The title pretty much explains the question. I have a user control loaded into the main window when the application is first run. What I want to do is to raise an event on parent window when a button on the user control is clicked, so how can I raise a parent event from button1_Click on the user control? ...

ASP.NET button_click not firing, after browser back button

I have a ASPX Page that contains several user controls, which are loaded dynamically after user interaction. On one of ascx I have a hidden button that is being clicked on some user actions (via button.click()), which works fine on 1st page load. But after the form is being submitted once, the other ascx is loaded. There if user clicks...

How do I find out if an object can be Invoke()'d?

Consider the following class: public class Event<T> { public delegate void Handler<t>(t msg); private event Handler<T> E; public void connect(Delegate handler) { E += delegate(T msg) { object target = handler.Target; if (Invokable(target) { target.BeginInvoke(handler, new obj...