event-listeners

How to get IFRAME to listen to same events as parent (and fire the same handlers)

I've got an HTML page (the parent) with an embedded IFRAME. The parent page has a couple of event listeners for mouse and keyboard events, as shown below (I'm using the Prototype library). var IdleMonitor = Class.create({ active: null, initialize: function(ii) { Element.observe(window, "mousemove", this.sendActiveSigna...

Is event listener using CPU time

Maybe this is a dumb question, but do event listeners use CPU cycles like a timer, or are they inactive until the event is fired? Is it language specific, or do all languages handle this basically the same? I want to write a tiny service that only does anything when a network disconnect event is fired, and I don't want the service to u...

how to add event listener via fluent nhibernate?

I want to add an event listener (IPreUpdateEventListener) to add NH but I can't seem to find an example when using a fluent configuration. I want to be able to add the listener when I create the session factory, e.g. when the following code is execute. _sessionFactory = Fluently.Configure() .Database(MsSqlConfigura...

Temporal data using NHibernate

Hi, Can anyone supply some tips/pointers/links on how to implement a temporal state-table with NHibernate? I.e., each entity table has *start_date* and *end_date* columns that describe the time interval in which this this row is considered valid. When a user inserts a new entity, the *start_date* receives 'now' and the *end_date* will ...

How to properly configure NHibernate event listeners

I'm trying to use an event listener for the first time. All samples I've seen show how easy it is to configure, but for some reason I'm having trouble - it doesn't seem to be called. I suspect I'm missing something obvious. I've tried this: <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory name="...

Dynamically adding listeners in goole maps where iframe src is set differently for each marker

Hi I've read the articles and the excellent piece on scope and closures by Robert Nyman. However i cannot get this to work. I'm trying to assign a mouseover event to various markers and then set an iframe src depending on the marker moused over. I get the infamous last entry for every mouseover event. I've played with it for the better ...

flash as3 document class and event listeners

I think i have this document class concept entirly wrong now, i was wondering if someone mind explaining it.. I assumed that the above class would be instantiated within the first frame on scene one of a movie. I also assumed that when changing scenes the state of the class would remain constant so any event listeners would still be r...

Android registerListener and battery life

In reviewing this post http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it, the highest rated answer says you should unregister and reregister the listener for the accelerometer onStop and onResume to conserve battery life. My question is how do we know which listeners we need to stop/resume to minimize our application...

Add objects to association in OnPreInsert, OnPreUpdate

Hi, I have an event listener (for Audit Logs) which needs to append audit log entries to the association of the object: public Company : IAuditable { // Other stuff removed for bravety IAuditLog IAuditable.CreateEntry() { var entry = new CompanyAudit(); this.auditLogs.Add(entry); return entry; } ...

JPanel.addComponentListener does not work when the listener is a class variable

I have a public class which has the following method and instance variable: public void setImagePanel(JPanel value) { imagePanel = value; if (imagePanel != null) { //method 1 : works imagePanel.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { System.out....

Does remove a DOM object (in Javascript) will cause Memory leak if it has event attached?

So, if in the javascript, I create a DOM object in the HTML page, and attach event listener to the DOM object, upon I remove the the DOM from HTML page, does the event listener still exist and causing memory leak? function myTest() { var obj = document.createElement('div'); obj.addEventListener('click', function() {alert('wh...

What is the purpose of event listeners?

What is the purpose of event listeners and how do I make use of them in a console application in Visual C#? Under what circumstances can I substitute them for threads, and would it be a good idea to do so? The reason why I ask is because I would like to make use of something to programmatically register button-presses on a Wiimote. Som...

Event notifications between iframe and parent

Hello - I am trying to send an event to iframes which have been opened by the application based on few events which should be prior registered by iframes. I cannot figure out how. I use jquery but I don't expect the iframes to be nice citizens to implement listeners in jQuery. Though I can mandate it - I am still looking for normal java...

signals and slots vs. events and event listeners

Straight to the point! How do signals/slots and event/event-listeners compare? Are there any pros and cons? Which one should I consider and why? Thanks in advance! ...

ActionScript 3.0 - Alternative Event Listener Declarations?

I have some in-file actionscript 3.0 code. This code controls a number of elements on it's stage. These elements each have an Over, an Out, and a Click event. I currently define these event listeners as so: mc_hotspot.addEventListener(MouseEvent.MOUSE_OVER, lift); mc_hotspot.addEventListener(MouseEvent.MOUSE_OUT, setDown); mc_hotspot.a...

Java JFrame Resizing

I know I can user componentResized to listen for when the user resizes a window. This isn't a very nice solution. If I do this and add a resize() method for the children components, it waits until the user finishes the resizing until it calls the resize() method. Is there a way to resize the child elements as the resize happens? ...