Trigger events when user closes a Web Form?

Hi. Is there a way to fire code (a trigger perhaps?) when a user unexpectedly closes the entire browser window by clicking on the X in the upper, right corner of the browser?
Or, is there a way to prevent the user from being able to close the browser window by clicking on the X?
Any help would be great. Thanks.
Edited by: sharpe on Jun 26, 2012 11:20 AM

The concepts behind a running form tend to be a mystery for some. However, there is no reason to believe that any Oracle magic occurs when running an Oracle Forms application. On the client side, the running for is a standard java applet. Like any applet running in a browser, the browser uses a plug-in (the JRE in this case) to support the content (the applet). The browser creates a container on the page where the JRE can present its content or host the applet, based on the underlying html. Once the applet starts, it will be displayed in this container space on the page within the browser window. In the case of Oracle Forms, we decided it would be nice to offer an option where the form could be exposed outside of this browser space and float freely.
So the answer to your question regarding what the "window" is called, well the browser is the "browser" and the floating window is actually a java frame which can be created in any applet. Again, no Oracle magic here. ;)
Generally, separateFrame=true is used when more real-estate is needed or when you simply do not want to see the browser controls. That said, I often recommend against using separateFrame=true for a variety of reasons. One of the most common reasons is that if the browser window which is hosting the form is closed or if the browser navigates from the current page, the running form will terminate. Because the browser, in this case, is not doing anything obvious, end-users can easily make the mistake of thinking it is ok to navigate to a webpage using the currently shown blank page. This will cause the form to close.
If you don't mind having the browser controls visible then using separateFrame=false is probably a better way to go. This would also allow you to use the note I mentioned in order to detect attempts to close the browser, assuming you are using Forms 10.1.2.3 or newer and JRE 1.6. To detect the closing of the "separateFrame" you likely would need to create a java bean, which may become a little more complicated than what can be described here. But remember what I mentioned above, if you use separateFrame=true and the hosting browser is closed, the form will also close. So in this case, you would have to code to detect both the applet frame closing as well as the browser window.
There are a variety of ways in which some of the browser controls can be hidden using java script, so this can offer some help if using separateFrame=false. So this is yet another option.

Similar Messages

  • End-user closes the Web browser's window...

    Hi ,
    I have an Exit_Form selection on a menu.....
    Is it possible the code being there to be executed whenever the end-user closes the web-browser's window.....???
    I use Dev10g.
    Thanks , a lot
    Simon

    Unfortunately... is is not applicable....because:
    1) Many users(application users) connect via a db user to the database.... , so i cannot relate each application user to a db session.
    2) The trigger on_logoff can not be used because of the first note....
    3) As i have written in my previous post the "exit_form" is not 'pure PL/SQL' code but 'forms' code.... It contains some 'erase(global_variables)' which are unknown to the db......
    Thanks , anyway...
    Simon

  • Tigger event when user change iphone time

    It is possible, we can trigger event if user change date and time of iphone.

    Did you traced ICI, if any de-register events getting published when you close IE.

  • Store data when user exits from web application

    is there anyway to call a method when user closes browser and session finish
    thank you

    I usually just use a HttpSessionListener.
    What's the difference?Lots ......
    This is from javadoc
    public interface HttpSessionListener
    Implementations of this interface are notified of changes to the list of active sessions in a web application.
    The implementation class would be invoked and in its methods, could process any action on session creation/termination
    public interface HttpSessionBindingListener
    Causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object. This may be as a result of a servlet programmer explicitly unbinding an attribute from a session, due to a session being invalidated, or due to a session timing out.
    The implementation class would usually be a bean. The bean thus has control to take any action it deems fit when its bound to a session or when its unbound from the session.
    Depending on the requirements, you could implement either of the two interfaces.
    Thanks,
    Ram.

  • Call JavaScript when user closes browser containing webcenter

    Hi
    Scenario:
    1. Webcenter is opened in a browser.
    2. User closes the browser
    Requirement:
    - When user closes browser containing webcenter, a java script (or a servlet) should get called.
    As you know, we can call a script in 'onunload()' of body tag.
    But how do we call it with webcenter?
    Thanks.
    Edited by: 873687 on Dec 14, 2011 5:34 AM

    Here is a few links that I found for the JavaScript side you might play aroudn with.
    http://developer.irt.org/script/1230.htm
    http://www.webreference.com/js/tutorial1/reference.html
    http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20953676.html
    http://www.devguru.com/Technologies/ecmascript/quickref/window.html
    And two in German
    http://www.uni-magdeburg.de/service/www/books/muenz/javascript/objekte/window.htm
    http://www.exine.de/clientseitig/js_work_events.htm

  • How sharepoint understand when user requests for web applications by their DNS names

    HI
    I configured Alternate access mapping in my sharepoint farm for default ,intranet zones
    and spt farm has two web front end servers and they load balancing by F5 device
    in WFE servers there are different web applications are running on different ports
    so here I want to know how load balancing works, load balancing configured in F5 device.
    when users request a webapplication from browser (ex http://cms) where this request will go
    1)when I ping cms and other web applicaations  it returns me a loadbalancer  server IP  for all web applications;
    ping cms : it returns 10.xxx.0.80 , same ip returns when I ping for other web app
    but ex CMS web application run on the 10.xxx.1.26:81 port in sharepoint server
    2) and these sharepoint web applications running on different ports in sharepoint  web servers , so here  how sharepoint understand when user requests for web applications by their DNS names
    http://cms and http://products  etc
    adil

    I'm not sure if the F5 can add a port number (I'm not an expert on load balancers).  But in general if you design the SharePoint site to run on port 81 then you need to have port 81 appended to the request or it won't work.  http://cms in your
    example would take you to http://cms:80 not http://cms:81.  But in general DNS will resolve the address back to the F5 load balancer.  The load balancer will look at the header of the HTTP request (which contains the original address you requested)
    and forward the request to the appropriate web front end IP address.  If your web front end is using one IP address for multiple sites then those sites need to be differntiated by using a custom port like 81 (which must be included in the original request)
    or because a host header was bound to the web application when it was created.  If they are running on different port numbers then the request must include the port number by the time it gets to the SharePoint server.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Raise event when user select a node or leaf of a recursive tree

    What is the event when user choose a node or leaf of a recursive tree? When I select the tree node / leaf it does not raise the event in OnAction. Thanks!

    Hi,
    TreeNodeType and TreeItemType have ONACTION event assocaited with them. This event gets called when the node or leaf is selected by user. Put a break point in these method, then you'll call to know if they are actually getting called or not.

  • How can i handle with event, when i close a file (notped or word,excel..)??

    How can i handle with event, when i close a file (notped or excel...). i want do something..
    Edited by: Legy on Apr 21, 2008 11:45 PM

    of course notepad.exe is closed again as soon as the operating system has completed the process of loading its content into memory...
    And no "event" is fired when that happens, except maybe internal to the process that loaded the application to indicate that it's been loaded successfully and can now be executed.
    But there's no way your Java process is ever going to receive that notification.

  • Record locks created when user closes the Browser and not the Web Form

    Hi. We sometimes encounter the issue where a user updates a record, locking the record on the table, but then they unexpectedly closes the browser without saving by clicking the X in the upper-right of the browser window. Then when another user comes along and attempts to edit that record they get the message Unable to Reserve Record. The orphaned record lock eventually does seem to clear itself out, but that can often take 15-20 minutes.
    Is there any way to speed this up? Or to pragmatically keep this from occurring? Either on the database side or with some code in a particular application?
    Please let me know your thoughts. Thanks in advance.

    If a user closes the browser window the forms runtime on the application server holding the locks is in most cases still up and running. The FORMS_TIMEOUT controls on how long a forms runtime on the server is up and running without the client applet not sending a heartbeat (See MOS note 549735.1). By default this is 15 minutes which would explain your locks being held 15 minutes.
    You could decrease the FORMS_TIMEOUT in the default.env, so the forms runtimes get cleaned earlier and thus the locks get released earlier.
    Note that if you have blocking client_hostcalls with webutil this might be a problem, as it prevents the forms applet from sending the heartbeat and after the FORMS_TIMEOUT passed while the forms applet is blocked the forms runtime on the server gets closed.
    cheers

  • Pre populating the database field when a user logs into web forms

    Hi,
    When my users log into the web forms application I want the database name field to be pre populated, how do I do this, I presume it can be defined in the config files ?
    Thanks in anticipation.
    SDG.

    Hi,
    I think u are refering to the username, password, database field (connect string)
    here. If this is the case then you can use LOGON(username, password||'@'||connectstring) procedure and hardcode the connect string.
    Best Regards
    Rajesh Alex

  • Releasing table locks when user closes browser

    Hi, I've read the blogs and tried some of the code that people have suggested but it just never seems to work.  I have locked table entries belonging to a stateful 2003 BSP.  The user closes the browser by means of the 'X' and the table locks remain.  I have table lock releases in the 'OnDestroy' event but that never seems to occur.  I have tried inserting JavaScript to capture the closing of the window but either it captures every other event or it gets confused when navigating to another page.  I have the redirect examples however they all seem to be part of a proper logoff procedure, rather than the cowboy approach of just shutting down the browser.  There must be a simple procedure out there to do this.  Is there a complete example somewhere?
    Any help will be appreciated,
    Kevin

    Hi Raja, ok I discovered why it isn't working and it really is quite obvious.  The browser that it's being tested on has a Google toolbar installed. Among other things this toolbar allows users to block the display of popups.  If this is selected the script will not run properly as it needs the alert to allow the server side to run.  This is going to be frustrating because while most of the user's desktop is managed by the corporation they still have the ability to add toolbars to their browsers and configure them, and I'm sure most people will select the popup blocker. 
    Kevin

  • How to capture when user closes browser

    I am implementing a scenerio where I need to reset login status in the database to false when a user closes browser without logout. I am at fix, how do I do that ????? With the java script solution, its a browser dependent and may not work with all the browser. With java sessionListener, the sessionDestroyed() method is never called when browser is closed.
    Plz. help... how can I capture the browser closing event. My application is running on Websphere and integrated with active directory for authentication and authorization.
    Thanks in advance......

    SoulTech2012 wrote:
    what about HttpSessionBindingListener?
    javascript solution doesn't sound good to me"hack" was chosen for that reason. Currently, there are no real good solutions for this. The browser runs autonomously from the server so there is not a lot that can be done. HttpSessionBindingListener is intriguing but I bet when the browser is x'd out of there is nothing sent to listen to.
    The first reply "reasonable timeouts" is the most relied on solution. All others are a lot of work for iffy pay back at best. This is one of the issues that has forced me into rather strict no session solutions.

  • Trigger event when items moved from a library to a document

    Hi all,
    I want to be able to trigger an event when a user drags items from a library in to their document, I had looked at the AfterMove event which I though might enable me to access any items after they had been moved (worst case scenario) but I can't seem to get this event to trigger.
    Any thoughts?
    Cheers
    JSX

    You can't really single out the selectionChanged or place events triggered by dragging items from a library from other selectionChanged or place events. See this thread for a relevant discussion and a link to the very useful Event Watcher extension. (It looks like afterMove is only triggered by a couple of objects, not including page items.)
    Jeff

  • Trigger event with user event

    Hello,
    I'm trying to trigger my event structure with an user event when my signal reaches a certain value.
    the ultimate goal will be to send a message trough queue to my consumer. for now I'm just trying to prove functionality.
    currently the event is always triggered once it's set of once and it wont stop.
    Here is what it looks like.
    thanks in advance
    Attachments:
    labview help.png ‏206 KB
    Trigger Send alarm practice-ev.vi ‏75 KB
    user_event_trig2.vi ‏13 KB

    Erik08085 wrote:
    Hello,
    I'm trying to trigger my event structure with an user event when my signal reaches a certain value.
    the ultimate goal will be to send a message trough queue to my consumer. for now I'm just trying to prove functionality.
    currently the event is always triggered once it's set of once and it wont stop.
    Here is what it looks like.
    thanks in advance
    i think a boolean crossing pt by pt with direction set to false-true, that will take care if your value swings in and out of your ranges 
    as mentioned, put the event structure in it's own loop....no point in having a timeout with an empty case

  • Force code execute when user closes OOB lightswitch app using the windows close red X

    I've created a lightswitch app using Forms Authentication.  If the user closes the application using the window close red 'X', I need to update a custom user profile table.  Is this possible?

    I use this code and it works!
    I handle the closing event of the user and I break it, execute my code ed after closing the application.
    Under you see the code that I use in my application.vb :
    Public Class Uscita
    ' Dichiara un evento per la classe
    Public Event Event1()
    ' Definisce un metodo per richiamare l'evento
    Sub CausaEvento()
    RaiseEvent Event1()
    End Sub
    End Class
    Protected Sub EsceAPP()
    Dim Obj As New Uscita
    AddHandler Obj.Event1, AddressOf Me.EventoUscita
    ' Provoca l'esecuzione dell'evento
    Obj.CausaEvento()
    End Sub
    Sub Eventouscita()
    Dispatchers.Main.BeginInvoke(Sub()
    RemoveHandler _mainWindowClose.Closing, AddressOf MainWindow_Closing
    System.Windows.Application.Current.MainWindow.Close()
    End Sub)
    End Sub
    Private Sub Application_loggedin()
    Try
    Dispatchers.Main.BeginInvoke(Sub()
    _mainWindowClose = System.Windows.Application.Current.MainWindow
    AddHandler _mainWindowClose.Closing, AddressOf MainWindow_Closing
    End Sub)
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub MainWindow_Closing(ByVal sender As Object, ByVal e As ClosingEventArgs)
    If MessageBox.Show("Vuoi Veramente uscire?", "Conferma", MessageBoxOption.OkCancel) = Windows.MessageBoxResult.Cancel Then
    'Elimina l'uscita utente
    e.Cancel = True
    Else
    'Interrompe momentaneamente l'uscita dell'utente per eseguire l'aggiornamento della tabella utenti loggati
    e.Cancel = True
    'Aggiorna la tabella utenti loggati ed esce dall'applicativo
    Me.Details.Dispatcher.BeginInvoke(Sub()
    Dim ws = CreateDataWorkspace()
    Dim query = ws.ApplicationData.UtentiLoggatis.Where(Function(c) c.UserName = Me.User.FullName).FirstOrDefault
    query.OnLineImage = MyImageHelper.GetImageByName("RedLight.png")
    query.OnLIne = "OFF"
    query.Logout = Now
    ws.ApplicationData.SaveChanges()
    'Chiama la routine per uscire dall'applicazione
    EsceAPP()
    End Sub)
    End If
    End Sub

Maybe you are looking for

  • Disappearing user settings

    Last year I set up a mini for my wife and added it to a small network connected to my iMac. To speed things I went through the mini installation as if I were the only user and she has been operating the mini ever since. Last week I was helping her or

  • JSF Data Table in Sequential Level

    Hi All, Assume i have a List and it contains 2 records. I need to display in Sequential Level in Frontend, When i use the below code <h:dataTable value="#{emp.detailList}" var="empVO" headerClass="tableheader" columnClasses="tablecell"> <h:column>   

  • Sold to party non editable in return case

    HI ..All, I have a scenario after return of sales process ,business wants  the same material to be delivered to the customer in normal sales process again.In that case while creating a new sales orde for that it will take the reference of original sa

  • How do I fix this ORA-00900 error?

    I keep getting the notoriously vague ORA-00900 error for the following Region Source code. +(start here)+ if ( (:P44_CAC_TO_SEARCH = '***All***') and (:P44_ASSET_TO_SEARCH = NULL) ) select "ID", "NAME", "TITLE", "COMPANY", "ADDRESS_LINE1", "ADDRESS_L

  • Is there a PDF User Manual for Photoshop Elements 10

    is there a pdf user manual for photoshop elements10 to download Message title was edited by: Brett N