Close window event

Dear Friends.
I'm back after fiew years to the BSP application.
Do you know how to control the X bottom of the internet explorer window?
regards

hi frank,
it can be done with java script...
<script language=javascript>
var needToConfirm=true;
window.onbeforeunload = confirmExit;
function confirmExit() {
  if(needToConfirm) return '<%=otr(package/confirmwindowclose)%>';
var origPre  = htmlbSubmitPre;
function htmlbSubmitPre() {
  needToConfirm=false;
  origPre();
</script>
thanks
jaideep
*reward points if useful...

Similar Messages

  • How to handle close window event?

    Hi all,
    Is there a way to handle event, if user unexpectedly close the window,
    the requiremnt is like if user closes the window he gets a dialog box such as"Are you sure you wanna exit" !

    Nothing out of the box in OAF.
    Thanks
    Tapash

  • MVVM close window event

    Hi everyone,
    I'm currently learning MVVM. 
    I want my application display the history and ask my user whether he/she is sure to quit or not . I've created a Custom MessageBox, it return false when user presses No and vice versa. I declare that Custom MessageBox in my xaml file and when the Closing
    event is fired, I want to display that MessageBox and retrieve the returned result . If the result is true, my application is closed.
    By the way, I'm using MVVM Light which made by Galasoft. 
    Can anyone help me please ?
    Thank you

    Why don't you close your previous thread(s) my marking helpful posts as answer before you open a new one?
    You should handling the Closing event of the window in the view model by using a command, pop up the MessageBox when this command gets executed and set the Cancel property of the CancelEventArgs to true to prevent the window from closing.
    Here is a complete code sample:
    View:
    <Window x:Class="WpfApplicationMvvmLight.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"
    Title="MainWindow" Height="350" Width="525">
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="Closing">
    <cmd:EventToCommand Command="{Binding Path=ClosingCommand}" PassEventArgsToCommand="True" />
    </i:EventTrigger>
    </i:Interaction.Triggers>
    <Grid>
    <TextBlock>content...</TextBlock>
    </Grid>
    </Window>
    using System.Windows;
    namespace WpfApplicationMvvmLight
    public partial class MainWindow : Window
    public MainWindow() {
    InitializeComponent();
    this.DataContext = new SampleViewModel();
    ViewModel:
    using GalaSoft.MvvmLight.CommandWpf;
    using System.ComponentModel;
    using System.Windows;
    namespace WpfApplicationMvvmLight
    class SampleViewModel
    public SampleViewModel() {
    _closingCommand = new RelayCommand<CancelEventArgs>(OnClosingCommand);
    private RelayCommand<CancelEventArgs> _closingCommand;
    public RelayCommand<CancelEventArgs> ClosingCommand {
    get {
    return _closingCommand;
    private void OnClosingCommand(CancelEventArgs e) {
    //display your custom message box here..
    var result = MessageBox.Show("Do you want to close?", "", MessageBoxButton.YesNoCancel);
    //set e.Cancel to true to prevent the window from closing
    e.Cancel = result != MessageBoxResult.Yes;
    For the above code to compile you need to reference the MvvmLight assemblies and System.Windows.Interactivity. Visual Studio will resolve all these references for you when you install the following NuGet package:
    https://www.nuget.org/packages/MvvmLight/
    Please remember to mark helpful posts as answer and helpful and please don't ask the same question twice.
     

  • Shortcut to close edit event window?

    You used to be able to hit ESC to close the event-window edit box. That doesn't seem to work with Snow L. (ESC wasn't the most intuitive keyboard shortcut for this task, but at least it was something) What's the shortcut now, so I don't have to mouse over and click "DONE" all the time?

    I'm glad I found this, I used to use "cmd-I" to close those edit windows, but that isn't working now. I never knew about "esc". That seems to be working.
    I wish they'd have "cmd-e" open and close edit windows, and have whatever they choose be consistent between iCal and Address Book. I always get the different key-codes for editing mixed up.
    I have suggested this to: http://www.apple.com/feedback/

  • How to write to windows event logs from determinations-server under IIS

    This is just an FYI technical bit of information I wish someone had shared with me before I started trying to write OPA errors to the windows event log... Most problems writing to the windows event log from log4net occur because of permissions. Some problems are because determinations-server does not have permissions to create some registry entries. Some problems cannot be resolved unless specific registry entry permissions are actually changed. We had very little consistency with the needed changes across our servers, but some combination of the following would always get the logging to the windows event log working.
    To see log4net errors as log4net attempts to utilize the windows event log, temporarily add the following to the web.config:
    <appSettings>
    <!-- uncomment the following line to send diagnostic messages about the log configuration file to the debug trace.
    Debug trace can be seen when attached to IIS in a debugger, or it can be redirected to a file, see
    http://logging.apache.org/log4net/release/faq.html in the section "How do I enable log4net internal debugging?" -->
    <add key="log4net.Internal.Debug" value="true"/>
    </appSettings>
    <system.diagnostics>
    <trace autoflush="true">
    <listeners>
    <add
    name="textWriterTraceListener"
    type="System.Diagnostics.TextWriterTraceListener"
    initializeData="logs/InfoDSLog.txt" />
    </listeners>
    </trace>
    </system.diagnostics>
    To add an appender for the windows event viewer, try the following in the log4net.xml:
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
    <param name="ApplicationName" value="OPA" />
    <param name="LogName" value="OPA" />
    <param name="Threshold" value="all" />
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    </layout>
    <filter type="log4net.Filter.LevelRangeFilter">
    <levelMin value="WARN" />
    <levelMax value="FATAL" />
    </filter>
    </appender>
    <root>
    <level value="warn"/>
    <appender-ref ref="EventLogAppender"/>
    </root>
    To put the OPA logs under the Application Event Log group, try this:
    Create an event source under the Application event log in Registry Editor. To do this, follow these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
    4.     Right-click the Application subkey, point to New, and then click Key.
    5.     Type OPA for the key name.
    6.     Close Registry Editor.
    To put the OPA logs under a custom OPA Event Log group (as in the demo appender above), try this:
    Create an event log in Registry Editor. To do this, follow these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
    4.     Right-click the eventlog subkey, point to New, and then click Key.
    5.     Type OPA for the key name.
    6.     Right-click the new OPA key and add a new DWORD called "MaxSize" and set it to "1400000" which is about 20 Meg in order to keep the log file from getting too large.
    7.     The next steps either help or sometimes cause an error, but you can try these next few steps... If you get an error about a source already existing, then you can delete the key.
    8.     Right-click the OPA subkey, point to New, and then click Key.
    9.     Type OPA for the key name.
    10.     Close Registry Editor.
    You might need to change permissions so OPA can write to the event log in Registry Editor.  If you get permission errors, try following these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
    4.     Right-click the EventLog key, select Permissions.
    5.     In the dialog that pops up, click Add...
    6.     Click Advanced...
    7.     Click Locations... and select the current machine by name.
    8.     Click Find Now
    9.     Select both the Network user and IIS_IUSERS user and click OK and OK again. (We never did figure out which of those two users was the one that fixed our permission problem.)
    10.     Change the Network user to have Full Control
    11.     Click Apply and OK
    To verify OPA Logging to the windows event logs from Determinations-Server:
    Go to the IIS determinations-server application within Server Manager.
    Under Manage Application -> Browse Application click the http link to pull up the local "Available Services" web page that show the wsdl endpoints.
    Select the /determinations-server/server/soap.asmx?wsdl link
    Go to the URL and remove the "?wsdl" from the end of the url and refresh. This will throw the following error into the logs:
    ERROR Oracle.Determinations.Server.DSServlet [(null)] - Invalid get request: /determinations-server/server/soap.asmx
    That error should show up in the windows event log, OR you can get a message explaining why security stopped you in "logs/InfoDSLog.txt" if you used the web.config settings from above.
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa363648(v=vs.85).aspx
    Edited by: Paul Fowler on Feb 21, 2013 9:45 AM

    Thanks for sharing this information Paul.

  • How do i end a sub vi when the close window control is clicked?

    Hi,
    I have a sub vi that sits in a while loop until a 'Done' button is pressed but sometimes the user clicks on the close window control in the top left of the window (MacOS) instead.
    After this has happened I would like control to return to the calling vi but it's as though the sub vi is still waiting for someone to click on the done button and the any user actions in the calling vi are ignored.
    How do I wire the close window into my program so as clicking on either it or the Done button will end the sub vi and pass control back to the calling vi?
    Thanks,
    Dave.

    The "event structure" can capture events for "this VI" that include "panel close". If you are using an event structure to look for the push of the Done button, just add another event that will catch the panel close as well (you can even configure the stucture to not pass on the close event). If you are not using the event structure to watch for the done button, perhaps you should. If you cannot use it in the same loop, you can put it in a parallel loop and use any of several signaling mechanisms to communicate between the loops.

  • Close window - need help

    Hi everyone,
    I'm working with JDeveloper 10.1.2, struts and uix pages.
    In my page1 I have a button to open a new window and in this new window I need to have a button to close it. I have done something like this:
    <submitButton event="EditarContactosEnfCs" formName="dataForm" text="Guardar1" onClick="javascript:window.close();"/>
    When I use onClick="javascript:window.close();" the window is closed (that is OK) but the event="EditarContactosEnfCs" is not executed. Why??
    Can enyone help me? Any ideias??? Please...
    Thanks,
    Atena
    Message was edited by:
    Atena

    Hi Ric Smith ,
    thanks for your replay :) it worked!
    I tried to do what you said like this, in strutsConfig.xml:
    <action path="/S2PopUpContactosEditar" input="/WEB-INF/page/S2PopUpContactosEditar.uix" type="oracle.jheadstart.controller.strutsadf.action.JhsDataActionEditarContactos" className="oracle.jheadstart.controller.strutsadf.action.JhsDataActionMapping" parameter="/WEB-INF/page/S2PopUpContactosEditar.uix" name="DataForm">
    <set-property property="bindParams" value="VOS2PopContactosAssoc1Iterator=${param.var2};VOS2PopUpContactos1Iterator=${param.var2}"/>
    <set-property property="modelReference" value="WEB_INF_page_S2PopUpContactosEditarUIModel"/>
    <forward name="EditarContactos" path="/S2Episodios.do"/>
    </action>
    and in the page where I need to submit, I have a button like this:
    <submitButton event="EditarContactos" formName="dataForm" text="Guardar" destination="S2Episodios.do"/>
    and the page that I'm going to open after submit, to close the window I add this:
    <body onLoad="javascript:window.close();">
    This works fine, but it's to slow. I see the message in the first page saying that the changes have beed commited and only then, go to the other page and close window.
    Is there another way of doing this? Make this faster, so when I press the submit button, the window is automatically close. Any ideias?
    Can anyone help?
    Thanks,
    Atena
    Message was edited by:
    Atena

  • Need to detect window event for applet

    I have an applet that needs to communicate with a servlet telling the servlet to logout once the parent window (web browser) is closed. I am new to programming with GUI's involved so I apologize for any ignorance. I have been searching for an answer on solving this problem for a while and have so far been able to write a simple applet that sends a message back to the servlet once the browser is closed by implementing the stop() function -- however it sends the same message when the back button is pressed. I need to message to be sent only when the browser is closed out.

    Applets aside, there is no way to tell the server
    when the remote user closes their browser. That&#8217;s
    just one of the pits falls of web applications.
    Now, in your applet, if it's possible to catch some
    sort of window closing event when the browser closes
    (and keep in mind I don't know if this is even
    possible) then in the applets closing event you may
    be able to use a URL object to post to your Servlet.That is what I was hoping to achieve -- I had defined my own stop() method which sent out a logout request to the servlet using the URL object... but it gets called every time a new page is requested. I also tried doing this in the destroy() method after reading that stop() should be called whenever a new page is requested to pause execution and that destroy() should be called when the object is reclaimed. This does not work how I expected in IE as it gets called each time a new page is requested -- must be destroyed and recreated every time.
    In the URL you can pass some type of ID that uniquely
    identifies your user. When the Servlet receives the
    request from the applet you can parse out the ID from
    the request and invalidate the users session,
    essentially logging them out.I don't have to worry about a unique ID as this servlet only serves a single user at a time -- on first connection it locks the servlet and will report to other users that it is busy.
    One other possible solution that I just found is the
    following:
    <script language="javascript">
    window.onbeforeunload = function (evt) {
    var message = 'Are you sure you want to leave?';
    if (typeof evt == 'undefined') {
    evt = window.event;
    if (evt) {
    evt.returnValue = message;
    return message;
    </script>This JavaScript function catches the window closing
    event. From this function you would have to use the
    JavaScript XMLHttpRequest object to send an
    asynchronous request to your servlet (read up on
    AJAX). Again, in the request you would need to pass
    your ID to uniquely identify the user that you want
    to log out.I will have to look at this -- although I want to do this in an applet that does not mean that would be the only solution that exists.
    Either way it&#8217;s not going to be simple. Cheers.
    -S

  • How to wire into that close window x button

    I want when the end user click the program's x red button at the top right, a dialog box with two buttons will pop out and say "are you sure?", if the end user click Ok, the program will shut off and close its window, if the end user click cancel, the program continues to run.
    So I start building the vi, refer attached, but I was flipping the help search without knowing what is the name of that red x button, and i cant find the function block!
    So, my question is:
    1. I want to wire into that x red close window button event to control my case structure, but where is that function block?
    2. Where is the function block that shut off the program as well as close the program window?
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    2.vi ‏7 KB

    I would add, by way of explanation, that you don't actually "tie into the button", you tie into the event that it represents.
    That means that if you add an event for PANEL CLOSE?, that event gets triggered by all the things that would close the window: Clicking the CLOSE box (as mentioned), but also typing CTRL-W, selecting CLOSE from the FILE menu (if that's available), aborting the program from the TASK MANAGER (ctrl-alt-delete), and script operations on OS X.
    Usually, that's what you want. The point is you're being asked if it's OK to close and you get a chance to say "no".  But it doesn't necessarily come from the CLOSE box.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Lots of Anyconnect Error Message in Windows Event Log

    Hi Community.
    We have lots of Anyconnect Error Messages in the Windows Event Log. Following two examples.
    Can anyone tell me why these errors appears and how do I fix them ? I already installed the newest Anyconnect on my machine.
    Thanks in advance and Kind Regards Patrick
    Example 1
      <Provider Name="acvpnagent" />
      <EventID Qualifiers="9216">2</EventID>
      <Keywords>0x80000000000000</Keywords>
      <EventRecordID>97564</EventRecordID>
      <Channel>Cisco AnyConnect Secure Mobility Client</Channel>
    - <EventData>
      <Data>Function: CNetEnvironment::logProbeFailure File: .\NetEnvironment.cpp Line: 1432 Invoked Function: CHttpProbeAsync::SendProbe Return Code: -27066354 (0xFE63000E) Description: HTTP_PROBE_ASYNC_ERROR_CANNOT_CONNECT HTTP (host: 109.164.211.237)</Data>
      </EventData>
    Example 2
      <Provider Name="acvpnagent" />
      <EventID Qualifiers="9216">2</EventID>
      <Keywords>0x80000000000000</Keywords>
      <EventRecordID>97565</EventRecordID>
      <Channel>Cisco AnyConnect Secure Mobility Client</Channel>
    - <EventData>
      <Data>Function: CNetEnvironment::TestAccessToSG File: .\NetEnvironment.cpp Line: 1385 Invoked Function: CNetEnvironment::analyzeHttpResponse Return Code: -28966899 (0xFE46000D) Description: NETENVIRONMENT_ERROR_PROBE_INCOMPLETE:Network Probe could not contact target</Data>
      </EventData>

    HI and welcome to Discussions,
    in my personal opinion there is not much for you to worry about.
    The 'Windows Tool for the elimination of malware' is nothing you miss as long as you have a decent Anti-Virus Software running.
    The update for the IE 7 might be missing an installed IE 7, which can do by downloading it yourself from Microsofts webpage.
    If you don't use the IE but something like Firefox or Opera or Safari, than don't bother with these update.
    Stefan

  • Window.event does not working in Firefox 4.0 and also window.event.ctrlKey ?

    hi,
    I'm using Microsoft virtual earth map 6.2 (bing Map) in my application.On map showing number of images.On Each image there is onClick event that select image if user press left mouse button while holding Ctrl key .For this I wrote java-script function where I'm using Window.event.button (To check mouse button) and window.event. ctrlKey(To check control key) But these both are not working in Firefox 4.0 ,the same is working in Firefox 3.6X version perfectly.
    Thanks

    The same problem is in Firefox 5.0 version too

  • Javascript Open and Close window

    I am creating a new website and am having problems getting
    the open window and close window to work. I want this window to
    open a new window (NOT a popup window used with the "onload"
    option). I am using an img tag so that when you click on the image
    thumbnail this new window opens. It is my understanding in order to
    use the window.close option, you must have the javascript in the
    header of the html document for the close to work. In the heading
    of the document that contains the link to open a new window I have
    the following:
    <SCRIPT language="JavaScript1.2">
    function popuponclick()
    Cellex = window.open("products/cellex.htm",
    "console","status=1,width=350,height=150");
    function closepopup()
    if(false == cellex.closed)
    cellex.close ();
    else
    alert('Window already closed!');
    </SCRIPT>
    Then I have this in the body:
    <img src="images/thumbnails/dermalogicath.jpg"
    alt="Dermalogica" width="94" height="84" border="0"
    /></a></td>
    <td><a href="products/mdskin.htm"
    onclick="window.open('products/mdskin.htm','mdskin',width=610,height=780,scrollbars=yes') ;return
    false; target="_blank">
    However, I'm getting script errors when opening the window on
    the lines in the body Unterminated error. I have tried using the
    help in Dreamweaver as well as many docs posted, but still cannot
    get this to work. Once I get the script errors resolved, the when
    the window opens, it will not close. I get the message that a
    window is trying to be closed and do I want to close the window
    which closes internet explorer entirely. I'm using IE 7.0 as well
    as foxfire and have the same issue on both. If I use the
    dreamweaver behaviors to call a javascript, it puts "onload" and if
    I change to "onclick" then the script will not work. When I use the
    behavior "open window" it still doesn't work. I'm totally lost as
    to what I'm doing wrong as I have followed about 10 papers all
    using the same instructions.
    Hopefully some one can help me, I'm getting fustrated as this
    seems to be pretty straight forward.
    Thanks, vienie

    Try this on for size:
    I have included two functions.
    windowRebuild() - opens a new window, maximizes it based on the screen size, removes all toolbars, and then closes the old window.
    myLocation(appName, pageName) - builds a url referencing an HTMLDB application, specfic to what server you are currently on. Very useful when you have an application on 3 different servers(dev, test, prod servers), you wouldn't want the server name hardcoded if you plan to export the app to another server.
    Also, you need to be careful when using &APP_ID. I am not completely certain how that is resolved at runtime, but I've found it only works when the javascript is in the HTML Header of a page and not stored in the template of the page.
    <script language="JavaScript1.1" type="text/javascript">
      This functions is for internal application use.
      Examples of myLocation:
      url = myLocation('&APP_ID.', 'APP_PUBLIC_PAGE');
      url = myLocation('MY_APP_ALIAS', 'MY_PAGE_ALIAS');
      url = myLocation('184', '10');
    function myLocation(myApp, myPage){
      var myHost = location.host;
      var newURL;
      newURL = 'http://'+myHost+'/pls/htmldb/f?p='+myApp.toString()+':'+myPage.toString();
      return newURL;
    /*  Function windowRebuild()
    *   This function will open a new window and close the old window.
    *   This function will also maximize the new window and remove all toolbars.
    function windowRebuild(){
       if(window.name != 'myAppWin'){
        var url = myLocation('&APP_ID.', 'PAGE_ALIAS');
        var myWin = window.open(url,'myAppWin','toolbar=0,scrollbars=1,menubar=0,status=1,resizable=1,location=0');
        window.opener = 'x';
        window.close();
       if(window.name == 'myAppWin'){
        window.moveTo(0,0);
        window.resizeTo(screen.availWidth,screen.availHeight);
    </script>Let me know if that works or you need some more explanation.
    Chris

  • Where did Close Tab and Close Window under the File tab go? I end up with all these open windows or exiting altogether.

    Under the File tab, I no longer see Close Tab or Close Window. Thus, I end up with a lot of open windows, because if I click File Exit, I'm logged out.

    You need to create a file userChrome.css in the chrome folder in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and paste the above posted code in the file.<br />
    You can use the ChromEdit Plus extension to make it easier to edit the file.
    You can access the profile folder via this button:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    That code will cause all hidden menu entries to get visible all the time, so you can use the mouse to open the menus and do not need to use the keyboard.

  • Mail In Full Screen Closes Window after Sending

    I love using mail in full screen.
    When I send a new message or reply to a message the Mail window closes out of the full screen and closes the mail window.  How do I get the window to stop closing after I send or reply?

    I found out what is was. I had serial mail try to send about 200 emails. Something went wrong (not sure whether it is lion compatible) and there were a load of unsent emails somewhere in the background. Funny thing was they were not showing anywhere, just when I tried to close window, an unsent message popped up.
    Anyway, force quit mail as I could not be bothered to find out how many mails had not been sent, and on reopening all back to normal
    HTH

  • How do I add a close window button/image

    All I want to do: Add a close window button (round/square with an "x" through it) to either one or many html files. I don't see how to do this.
    Using RoboHelp 8 HTML and WinXP. Thanks.

    Ahh I see now. You are asking where to obtain such an image!
    The RoboHelp Gallery doesn't contain one. Sorry. You will need to obtain one from any number of other locations.
    You might look at the following link for one possibility.
    Icon Archive
    Here are a couple from my own colloection. You might right-click and save as.
    There are also a number of packages you may purchase or find. Perhaps the following link will help.
    Click here to search Google
    I cannot advise on the legal implications of using said images.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

Maybe you are looking for