events

Adding event handler to an iframe using JQuery

I want to assign a keydown event handler to an iframe. Something similar to the pure JS: document.getElementById('iframe_id').contentWindow.addEventListener('keydown',funcName, true); I tried: $(document.getElementById('iframe_id').contentWindow).keydown( function() { // my func }); But it does not work.. Please help! ...

C#: events or an observer interface? Pros/cons?

I've got the following (simplified): interface IFindFilesObserver { void OnFoundFile(FileInfo fileInfo); void OnFoundDirectory(DirectoryInfo directoryInfo); } class FindFiles { IFindFilesObserver _observer; // ... } ...and I'm conflicted. This is basically what I would have written in C++, but C# has events. Should I...

ASP.NET page events - Button click event comes after GridView bind

My understanding of the order of page events is this: Page : Load Control : DataBind (for a GridView or whatever) Control : Load Control : Clicked (for a Button) Page: PreRender Control : PreRender (There are lots of others - but these are the ones I'm interested in) The important thing to notice here is t...

A problem with FormClosing property

Dear all; i want to set a property that when the user clicks on X button in the title bar it check for some condition if all conditions are true then exit if no then do nothing and return to the form .. but i noticed that FormClosing property exit the application howevere are my conditions ... so how to do my scenario ?!? i'm using vis...

How do I listen to all Seam contextual events with parameterized names?

Seam will fire different kinds of events that relate to particular scopes, tasks, or processes and appends the name of the scope, task or process to the end of the event. How do I listen to all the events of a type? E.g. for any <name> I'd like to listen to events such as these: org.jboss.seam.createProcess.<name> — called when the p...

Event taps: Varying results with CGEventPost, kCGSessionEventTap, kCGAnnotatedSessionEventTap, CGEventTapPostEvent

I'm running into a thorny problem with posting an event from an event tap. I'm tapping for NSSystemDefined at kCGHIDEventTap, then replacing the event with a new one. The problem I'm running in to is that depending on how I post the event, it's being seen only by some applications. My test applications are Opera, Firefox, Quicksilver, an...

How do I override the OK / Apply Event within an SCCM integration property page?

I am writing an SCCM integration by using the SCCM SDK. I have created a new property page which fits into the advertisement property dialog. In case I open the property dialog AND especially my own created page, I can override the OK and apply events, but if I did not open my own page, my override functions are not used. So the questi...

When to unhook events in Silverlight

One-line summary: What is the best practice for unhooking event handlers created in the constructor of a UserControl in Silverlight2? Background: I am currently building a line-of-business application in Silverlight2. As Silverlight is a browser plugin, there is no concept of a Window - everything is done within UserControls. The way I'...

CompositeWPF: EventAggregator - when to use?

Hi, I've been looking in to the Composite Application Library, and it's great, but I'm having trouble deciding when to use the EventAggregator... or rather - when NOT to use it. Looking at the StockTraderRI example, I'm even more confused. They are using the EventAggregator in some cases, and "classic" events in other cases (in for exa...

ListView's DragEnter, DragOver, DragDrop event not raised (AllowDrop=True)

Hi all. This one is very weird: My app works just fine, but suddenly the damn ListView control's events are not raised any more. It just comes and goes without any clear reason. (Obviously) I've set the AllowDrop property to True and handled the DragEnter, DragOver and DragDrop events as follows: Private Sub lstApplications_DragDrop(B...

Raising Events From Interface (win forms)

Hi All, My scenario: Windows Forms Application with a base master (mdi) form. Public Interface IDoSomething that has an event: Event AddFilter() Modal popup window implements the interface and decalres event: Public Class frmPopup Implements IDoSomething Public Event AddFilter() Implements IDoSomething.AddFilter Popup also conta...

Flex - How to get Tree itemClick event to mimic itemOpen event?

I am using a Tree control with an XMLListContainer dataProvider.... I use an itemOpen event with the following code to update another data provider when a tree folder is opened (using small triangle) - the data provider contains all the <slide /> elements in that particular tree folder... private function itemOpenEvent(event:TreeEvent):...

Difference between events and delegates and its respective applications

I don't see advantages of using events over delegates, other than being syntactical sugar . Perhaps I am misunderstanding, but it seems that events is just a placeholder for delegate. Would you guys explain to me the differences and when to use which? what are the advantages and disadvantages? Our code is heavily rooted with events, a...

Tricky jQuery operation, not sure if I am using 'this' property either.

Using jQuery, I am binding some image tags with a click event like this: $('.imageClass > a > img').bind('click', onImageClick); this.onImageClick = function() { $.post("/blah/123", { test : 'a' }, function(data) { myCallback(this, data); }, "json"); } this.myCallback(event, data) { alert($(event).parent.attr("href")); }; My...

Flex menuBar event when clicking an item that is not a subMenu

is there a way to handle menuEvents like the ones used in submenus but in top level menus that doesent have sub menus? and use a function like: private function menuHandler(event:MenuEvent):void { if (event.item.@data != "top") { Alert.show("Label: " + event.item.@label + "\n" + ...

show a message box when user close IE

Hello everyone, Any javascript to prompt a message box when a user closes IE? I have tried to find a code sample for quite a while but failed. thanks in advance, George Here is my html code, but it has the following error. Any ideas? To help protect your security, Internet Explorer has restricted this webpage from running scripts or ...

ASP.NET Controls and Update Panels

I am creating a series of client side component controls on the fly that are nested inside a update panel. The first time I create the controls, everything works as desired, however, when i trigger an update on the update panel and it does a partial postback the controls come back with several javascript errors describing how the contro...

JavaScript: Cancelling events cross browser

I am implementing a floating pop-up help control in an asp.net web site, and i'm using JQuery to implement the whizzy bits. The pop up is made visible by clicking on a link, the link also has an href poining to another page to support users with JavaScript disabled. I added "return false;" to the end of the Javascript string in the onCl...

Strange behavior when using lambda expression on WPF buttons click event.

My problem is hard to explain, so I created an example to show here. When the WPF window in the example below is shown, three buttons are displayed, each one with a different text. When anyone of these buttons is clicked, I assume its text should be displayed in the message, but instead, all of them display the same message, as if all ...

Event Receiver for Document Library

I'm trying to update one of the properties of a word document from an event receiver. I'm handling it with the ItemAdded event and updating the property as is: // Modify property DisableEventFiring(); properties.ListItem.File.CheckOut(); properties.AfterProperties[HelloWorldInternalFieldName] = "Hello World!"; properties.ListItem.Updat...