closing

FLEX: How to know when a dialog created throw PopUpManager Closes

Is there a easy way to figure out consistently when a Dialog closes that has been created through PopUpManager. I would have suspected some type of message or callback mechanism, but there does not seem to be. In one case I use the WindowTitle component and event that only fires the CLOSE if someone presses the close and give no messag...

Closing Window in IE8

I have a some javascript that calls is calling for a popup (media player) to load. That works But I want the parent page to close or not even appear to have opened. This works great in Firefox. Code is: window.open("radio.html","Levante_Radio_Live","width=323,height=281,scrollbars=no,menubar=no,location=no",); window.close(); ...

In Python, how to make sure database connection will always close before leaving a code block?

I want to prevent database connection being open as much as possible, because this code will run on an intensive used server and people here already told me database connections should always be closed as soon as possible. def do_something_that_needs_database (): dbConnection = MySQLdb.connect(host=args['database_host'], user=args['...

Silverlight 3 Window.Closing Event or how to stop a user from closing a browser to stop a running timer

do we have Window.Closing Event in Silverlight version 3? If not, is there an easy way to check if the user is closing the browser and to stop him doing so unless he explicitly stops a running timer? Regards, Nadeem. ...

Closing a MenuStrip programatically

I have a MenuStrip that I have added to a form, and in one of the dropdown menus in it, I have a text box. When I hit enter on the textbox, I want a function to run, then the drop down menu to close. I know how to get the enter part done, but I have no idea how to close the MenuStrip dropdown menu. Does anybody know how to do this? ...

How to prevent jQuery FancyBox from closing immediately after submit?

Hi! I'm loading an inline registration form in a FancyBox from jQuery. However after submitting the form, the box immediately closes while there is some feedback that I want to show the user in the FancyBox itself. This feedback is generated on the server side and is printed in the FancyBox. How can I make the box only closing when the...

Need to know when application is closing

Is there a way to monitor when an application that is using the dll closes? The DLL and the application are both C#, neither are Windows Forms. I can check when the main application is closing, but I would like for the DLL to see "hey the program is closing and releasing me, I should do this real quick before I die". Any way to do it? ...

How do I avoid closing an InputStream passed to my method that I wrap in Reader streams?

I'm creating a Java method that accepts a single InputStream as an argument. For the convenience of working with a character-based stream, I wrap the provided InputStream at the start of the method implementation as follows: public void doStuff(InputStream inStream) { BufferedReader reader = new BufferedReader(new InputStreamReader(...

Dao methods, manipulating single/multiple objects and closing resources

The usual advice is to close JDBC ressources once they're no longer needed. This could be done in a catch and finally. However, what if a DAO method only manipulates one domain object and an operation requires several of these to be retrieved/created in one go? Would getting a statement and then closing it repeatedly be an issue in terms...

Undefined property error with Event.CLOSING

I was using the Flex 3.5 + AIR 2 beta 2 SDK for some time now for one of my projects. Moving to the final 3.5 release today causes the compilation to fail with the following error. Error: Access of possibly undefined property CLOSING through a reference with static type Class. This happens in the following line. this.addEventListener(...

How can I create a self closing tag using JDOM

Hi there, I could find in Jdom api any function to create self closing xml tag like the <selfClosingTag /> below. For example, I need to create the following content: <parentTag> <selfClosingTag /> <firstChild>...... </firstChild> <secondChild>...... </secondChild> </parentTag> Can someone please tell me how. Please te...

Who should be responsible for closing a stream

I'm writing an application that creates a "Catalog" of files, which can be attributed with other meta data files such as attachments and thumbnails. I'm trying to abstract the interface to a catalog to the point where a consumer of a catalog does not need to know about the underlying file system used to store the files. So I've created ...

c# AcceptButton and validation

Hi I have a form which contains of several textboxes and two buttons Cancel and Ok. These buttons are assigned to accept and cancel buttons properties in form. The problem is that I have to validate texts entered in all textboxes. I want to do that if user click Ok button(which is acceptButton). So I wrote a function which is reponsibl...

Javascript closing tag is echoed twice from php

<?php echo "<script type = 'text/javascript'></script>"; ?> output's page source shows this : <script type = 'text/javascript'></script></script> Why is it putting an extra closing tag ?? and who is putting it there ?? browser ? server ? who ? ...

Ask user before closing C# WPF application

Hello. I want to ask user before closing application. I's C#.NET 4.0 application. I'm using WPF. I can do it in windows forms, but not in WPF. Event is fired when user want to close app, message Box appears, bun no matter which button is pressed(Yes or No) application always closes. Why? Where is mistake? It works, but only when user pr...

Best Practice for WCF proxy lifetime - or how often to close a WCF proxy?

I've been working on a WPF application that uses WCF to access the server side logic & database. I started with a single WCF client proxy object that I was using repeatedly to call methods on the server. After using the proxy for a while, the server would eventually throw an exception (System.ServiceModel.EndpointNotFoundException: The...

Closing MDIParent Form, application is still running in task manager

So I can't seem to completely exit the application, I want this to happen when the user clicks the (x) button. is there a certain command like application.exit I can put somewhere (maybe FormClosed()?) Thank you! ...

X-Button changing Color Value

I have been spending a lot of time on a 3-Color Averager it take the three colors from a JColorChooser instead of letting java create a dialog I made my own, it has the JColorChooser filling everything but the bottom were a single button labeled "OK" everything works fine except this I added a Window Listener and under windowClosing I ...