events

jquery click event from a checkbox not working as expected.

I have a few checkboxes on my form. I would like to run a bit of javascript when someone clicks them. I've tried the following code after much head scratching and have no idea why its not working. $().ready(function () { $('#uploadDirs').find(':checkbox').each(function () { $(this).attr('onClick', "alert('hello');"); ...

Tracking changes in the Active Directory using C#

Hi Guys, I was just wondering is there a way to raise events if someone changed something in Active Directory. Eg. disable user account ...

JScrollBar programmatically

How can I move programmatically a JScrollBar based on amount of wheel mouse rotation? ...

Catch Click events on Tabs

Is there a way to catch a click event on a TabControl tab so that you can say if clicked at a certain point that it doesn't switch to the clicked tab? Here is the code that is used to find the area that if clicked in i do not want it to switch tabs. RectangleF closeArea = (RectangleF)tabStrip2.DisplayRectangle; closeArea = ...

Javascript add events cross-browser function implementation: use attachEvent/addEventListener vs inline events

In order to add events we could use this simple 1st solution: function AddEvent(html_element, event_name, event_function) { if(html_element.attachEvent) //Internet Explorer html_element.attachEvent("on" + event_name, function() {event_function.call(html_element);}); else if(html_element.addEventListener) //Firefox &...

SOA service calling back a client

This is more a theoretical question than a practical one, but given I undestand the principles of SOA I am still a bit unsure about if this can be applied to any app. The usual example is where a cliente wants to know something from a server thus we implement a service that can provide that information given a client request, it can be ...

Is this a correct syntax for generic delegates and events?

I'm reading the msdn library topic about genrics . There is an example of declaring event wiht generic delegates, but is it correct? // Code block 8. Generic event handling public delegate void GenericEventHandler<S,A>(S sender,A args); public class MyPublisher { public event GenericEventHandler<MyPublisher,EventArgs> MyEvent; pu...

IE6 and IE7 onMouseout event toElement problem for dropdown

I have a div#dropdownCont with onmouseout and onmouseover listeners attached via: domTarget.attachEvent('onmouseout', function(e){hideDropDown(e);}); domTarget.attachEvent('onmouseover', function(e){showDropDown(e);}); The dropdown works like this -- when mouseover event happens, the div#dropdownCont expands downwards as its childnode...

jquery, using API event issue, delegate, live event.

Hello everybody, I have a question what I try to understand for a wile. When I am using API feed with jquery I always have a problem, it is "click", "ready" ... events, which makes me to apply some hacks or to choose another way. For example Flickr API: $.each(data.photoset.photo, function(i, rPhoto){ var basePhotoURL =...

Ensuring an event is handled while switching gen_event handlers in Erlang/OTP

Let's say I have several versions of a gen_event handler and want to change them around while the program is running: -module(logger_all). -behaviour(gen_event). -export([init/1, handle_event/2, terminate/2]). init(_Args) -> {ok, []}. handle_event({Severity, ErrorMsg}, State) -> io:format("***~p*** ~p~n", [Severity, ErrorMsg]), ...

Detect if jQuery plugin is applied to multiple elements?

I'm working on a jQuery plugin that can be applied to multiple elements. The plugin includes some animation effects and I need to manage the event queue based on if the plugin is used on multiple elements (instead of one). What's the best way to detect if the plugin has been applied to a single element or to multiple elements? Edit... ...

jQuery's delegate() not running properly in Safari, works fine in all other browsers

I'm working on a JavaScript-based banner for a client and have hit a wall. The banner runs fine in Chrome, Firefox, IE7 and 8. Safari, however, allows the user to close the banner once and open it once, then it stops responding to clicks. The user should be able to open and close the banner as many times as they'd like. Rather than c...

button click event on User control

Hi, Stucked in a problem??? I have a master page, containing ContentPlaceHolder. The ContentPalceHolder contains a div (inside update panel) which has to be used to load UserControls dynamically(using LoadControl). Now i have loaded the Report navigation UserControl to the div, which contains Buttons for all the reports available to th...

triggerHandler vs. trigger in jQuery

Out of curiosity -- what is the purpose of / use cases for jQuery's triggerHandler? As far as I can tell, the only "real" differences between trigger and triggerHandler is whether or not the native event fires, and event bubbling behavior (though triggerHandler's bubbling behavior doesn't seem hard to replicate with trigger in a few more...

WPF Is it legal to invoke another event from within an event-invocation-method.

The following code was part of an answer I have received to solve a probem I have posted in SO. It works fine, however I'm curious if its allowed to manually invoke another event from within an invocation-method with the EventArgs of the original event: protected override void OnMouseLeftButtonUp( MouseButtonEventArgs e ) { ba...

Event Handling [Android]

I wrote simple Application for Android: public class Figures extends Activity { DemoView demoview; int figure_type = 1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); ...

With this .NET event, is it OK to pass in this IList instance?

Hi folks, i've got the following code :- while (....) { var foo = DoTheFooShakeShakeShake(..); foos.Add(foo); // foos is an IList<Foo>, btw and is new'd, above. if (foos.Count % 100 == 0) { var e = new CustomFooEventArgs { UserId = whatever, Foos = foos }; OnFooPewPew(this, e); foos.Clear(); ...

how to use Picture.LoadFromFile() in TcustomContol

I created a TSkinPanel derive from TcustomControl it has a FGraphic: TPicture. the FGraphic is drawn on the canvas of the TSkinPanel and works fine if you load and image from the TObject Inspector. but i doesnt won'k work on loading image on runtime "Form1.SkinPanel1.Picture.LoadFromFile('skin.bmp'); ...

Where should I put code to execute once after my Delphi app has finished initialising?

I have functions I want to perform after my app has finished initialising and the main form has been created. I did have the code (call it ProcedureX) in the forms OnShow event, but I have just noticed that it is being called twice, because OnShow is firing twice. It fires when the main program DPR calls: Application.CreateForm(TMainF...

Java Game - Easiest way to draw buildings.

It's my first time doing Java GUI stuff, and I have a few questions. I'm making a simple side-scrolling game - planning it out, specifically. The window is going to be 800x800. There's going to be buildings drawn as the game scrolls (every 40 px or so). I'm thinking that I'll make one 900px black rectangle, and then set copies of it at...