How to call a method when the browser is closing

Hello,
   In my application I need to execute a specific treatment when the WD4A application is closing.  So how can we have a handle method for this specific event.
   I've seen some documentation about the "exit plugs" , and about the doonclose method of the window.. but I don't think it can be useable for me in this case.
Can you please help me
Thanks in Advance
Hamza

I wrote an insert into the method i set up a break point, the program never call this code and therefore, the new row is never inserted.
But i think, it's a misunderstand. 
to summarize :
I have an application in WD4A
The application is running, and then I decide to close the browser (in my case internet explorer) and before the browser close I want to execute a piece of code.
If the method wddoonclose is to be used, is there any default handler or listener to trigger it automatically on the browser closing ?
If no, how to trigger a method base on this special event .
Thx
Hamza

Similar Messages

  • How to logout an user when the browser is closed?

    Hi,
    does someone knows how to logout an user when the browser is closed?
    Thanks.

    Hi,
    There is an api wwctx_sso.cleanup_sessions which removes old sessions. This takes a parameter "p_hours_old" which indicates the age of the sessions which need to be removed. There is a job which runs which in turn calls this api to clean up sessions which are 7 days old or 168 hours old. You can see this from the dba_jobs table. You can try running this api.
    Thanks,
    Sharmila

  • Persisting a session even when the browser is closed

    i want to persist a user session even when the browser is closed. How to do it through cookies. I know i define a cookie, set its max age and then put that in response. But its not working.
    I am using I.E

    i am not sure if i am doing something wrong. the cookies are enabled and i see that for ie 7, if i open a new tab the session is maintained but if i open a new window (of I.E. 7) altogether then the session is not maintained. Interestingly the code is working in firefox. is there some problem with the I.E. only?

  • Destroy the session automatically when the browser is closed by user

    Is it possible to automatically destroy a session when the browser is closed by the user with the X?
    Basically, what we want to do is to create the same effect when the user is closing the browser (with the X button) as when the ordinary log out button is used. That is to have the session destroyed.
    Any ideas?
    /Carl-Johan

    Hope this helps...
    Refer note : 904155
    from SAP Note 904155----
    Symptom
    A BSP application is not terminated correctly when the user closes the browser window or navigates to other URL.
    The popup window, which appears on browse closure, contains the
    text representing <img> HTML element content in the escaped
    form, like that:
    <IMG WIDTH=quot; HEIGHT=quot; SRC="...
    After the popup disappears, the session remains opened.
    Since the session is not removed, that may result in database locks that still remain and can be found in transaction SM12.
    Other terms
    Business Server Pages, WebAS, sessionexit, session termination, SM12, SM04, SYSTEM, session_single_frame.htm
    Reason and Prerequisites
    Reason:
    The problem is caused by the minor code inconsistency in BSP application SYSTEM -> page SESSIONEXIT.HTM.
    Prerequisites:
    1. The application is using the SYSTEM application page SESSIONEXIT.HTM for logoff. When it runs, suddenly HTML source code appears on the logoff screen.
    2. SAP_BASIS 620 SP57 or SAP_BASIS 640 SP15 or SAP_BASIS 700 SP06 are installed.
    Solution
    Please install SAP_BASIS 620 SP58 or SAP_BASIS 640 SP16 or SAP_BASIS 700 SP07
    or
    apply the code correction as described below:
    1. Go to BSP Application SYSTEM.
    2. Select page SESSIONEXIT.HTM and turn on Change mode.
    3. Change the line:
    <%=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>
    to:
    <%raw=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>
    Arun
    P.S Assigning points is a way of saying thank you on SDN
    Message was edited by: Arun Varadarajan

  • What happens when the Browser is Closed?

    Hi,
    Does anyone know for sure what happens to your CF template that is running on  the CF server when the browser is closed by the user.  Does the CFML continue to  be processed or is the template aborted?
    Suppose the user hit's submit to  a long running process (relatively) and the user closes the browser.  Does your  code keep running?  Or does CF abort the process?
    This seems to be a  tricky question as I've posed it indirectly for an e-commerce related question  involving CFHTTP (which may be different).
    Thanks,
    hefterr

    The code will keep running, CF has no concept whatsoever of the fact the browser has closed.

  • How to call a method in the servlet from an applet

    I want to get the data for the applet from the servlet.
    How to call a method that exits in the servlet from the applet? I want to use http protocol to do this.
    Any suggestions? Please help.
    thanks

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • How to call an action when the user selects a radiobutton

    Hai
    PLease help me in providing the information.
    In my Project i have two radio buttons as
    New
    Asssessment
    when the user selects new button, i want to automatically call an action in the controller(.jpf file)
    Simalarly when he selects the other radio button i need to call a separate action in the controller.
    Remember i dont have the submit button.
    I want to dynamically call an action when the user selects the radio button.
    i dont have any field inthe radio button which actually takes action as an attribute .
    please provide me the necessary

    Hi,
    You can use JavaScript to call the action in interest upon the Radio Button Element Being Selected.Should be simple, and if your controller is part of the portlet dont forget to use the jpfScopeId to asscoiate the controller instance with the one in the portlet.
    Let me know if you have any further questions.

  • How do I close a PDF document automatically when the browser is closed?

    I have a web app writen in HTML/ASP. In order to acccess this app, our users have to enter a password and user id. Once on the main page of the app, they can click on a link which opens the reader in another window. Quite often, when finished with the app, they close the browser, but leave the reader window open (with sensitive information). It is becoming to riskly to hope that they remember to close that window also, even with visual reminders. I would like for that window to close automatically when the browser with the app is closed.
    Can this be done?

    Let me elaborate a little more on what I am trying to do.
    (1) A website (#1) is opened after entering a UID and PWD.
    (2) Within website #1, a link is clicked which opens a second web app (#2) in a seperate window using window.open().
    (3) Within website #2, a user can click on a link which opens a PDF as _SELF.
    (4) If the user:
         (a) exits out of website #1 by closing the brower
         (b) we would like to automatically close the PDF from website #2 also, as this contains sensitive information and most of the time the users are forgetting to close it

  • How to call a method when initialing the page?

    Help! I need to call a method to get some information from server to create a part of the page.
    But I don't konw what to do, Is there a function similar to the Flex's createComplete in JavaFX.
    please give me an example to show how to do that.

    DoStuff();
    Stage { scene: Scene { ... }}DoStuff() (or equivalent code at script level) will be executed first.
    You can also use the public override function run() function to ensure it is executed first.

  • How do I call a method when the user clicks on the delete button?

    Hello , I need to implement the following :
    If date from is less than sysdate , when the user clicks the "delete" button , he is shown an error message .
    Can you please help how this can be done ? Thanks.

    Thanks. What are the steps for adding a custom delete button ?
    Are these ok ?
    1 ) Add an adf button
    2) Add the following in the actions listener : #{bindings.Delete.execute}
    3) Right Click button --> create method binding for action
    4) Compare date ?
    Thanks.

  • Newbie: How to call a method when a JFrame closed ?

    Hya,
    how I can call a method to perform some operations when the JFrame's close(x) button is pressed?
    thanks in advance

    try this
    (change System.exit(0) if you don't want to close the app)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setLocation(300,200);
        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);//<---------
        setSize(300,200);
        addWindowListener(new WindowAdapter(){//<-----------
          public void windowClosing(WindowEvent we){
            someMethod();
            System.exit(0);}});
      public void someMethod()
        JOptionPane.showMessageDialog(this,"Closing...");
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • How to call a method when navigating records?

    Jdev 11.1.1.2.0
    I have an app displaying records one at a time in a panelFormLayout.
    I have a selectManyShuttle object linked to the form with a PartialTrigger.
    The shuttle is being populated using the methods from the SRDemo app and are functioning correctly when adding/removing records including the correct parent id through the partialtrigger.
    But, the shuttle is not refreshing as the parent record is changed. I have to manually refresh it.
    How can I attach a method call #{backing_MessageTrainingCenters.refreshSelectedList} to fire when the parent record navigates or is there a way to do this automatically?
    Same question with the commit button. I currently have a save button for the shuttle and a commit for the parent. I would like to call the method to save the shuttle records when the commit is pressed.

    What I've done to sort of get this to work
    In the backing bean (using the SRDemo stuff) I changed the refreshSelectedList to use an ActionEvent
    public void refreshSelectedList(ActionEvent event) {
    refreshSelectedList = true;
    I right-clicked one of the the built in nav buttons and told it to create method binding for action then took that method and made it take a string for the operation.
    public String navAction(String navigate) {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding(navigate);
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    I made 4 buttons and set the ActionListener to #{backing_MessagePrograms.refreshSelectedList} on each one then did a create method binding for action.
    Inside each of these methods I made a call to navAction(String navigate) above passing in the operation I want.
    public String cb8_action() {
    cb2_action("First");
    return null;
    This works ok for this single scenario but I have 2 multi select lists to refresh when navigating. So I'm still stuck with trying to tell the other component to refresh.
    I cannot find the "magic" that happens when I click the button with the listener ActionListener set that makes it refresh.
    How can I tell both multiselect components to refresh from one of my methods?
    or
    *How can I set a button to use 2 ActionListeners like #{backing_MessagePrograms.refreshSelectedList} & #{backing_MessageTCs.refreshSelectedList}?*

  • How  can call a method incide  the method in jsp

    I wrote some statement inside the scriptlet(<% %>)
    then i want call another method ,that one inside the same script let..please replay...

    please help How can write a function inside the JSP

  • How to force the end of an user session when the browser is closed?

    Hi,
    When the user close the browser, the portal session remains. If the user open a new browser window, we ill be back to the portal without the need of a new Login. Is there any way to force a new login in this situation. A similar problem happens also when there is a reboot in the application server. After the reboot, all users can connect to the App Server without the necessity to login.
    Is ther any way to avoid this kind of behavior?
    Thanks.

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • Does the sharedObject get destroyed when the browser is closed?

    hey guys, so i just wanted to make sure that when my internet browser is closed it destroys or clears my sharedObject??
    right now i wasnt sure so im doing somehting like the following
    public var sharedObj:SharedObject;
    if(sharedObj != null){
         sharedObj.clear();
    sharedObj = SharedObject.getLocal(...);
    i just wnated to make sure that this is the most effective way to destory the sharedObject just in case there is one left in the browser...
    is there another way to make sure i clear the sharedObjects??

    hello cyber0897,
    No sharedObjects are stored in a cookielike textfile on the clients harddrive, As far as I know there is not an option like with cookies to be destroyed after the browser closes.
    The reset you wrote should be in another order:
    var mySharedObject:SharedObject = SharedObject.getLocal....
    //the above will never give null, because it is created when it doesnt exist.
    //the if (object != null) is useless because of the above, in your post it will be always null, since it is not instantiated...
    mySharedObject.clear();
    mySharedObject.flush(); //not sure if this is neccesary
    You could reset the sharedObject when initializing your application, but if you just want to store variables and get them wherever you need them in your app you could use the singleton class below
    Usage:
    <s:TextInput id="text1" text="@{PrefObj.instance.myString} />
    <s:TextInput id="text2" text="@{PrefObj.instance.myString} />
    (the @ only works in flex 4)
    PrefObj.as
    package
        import flash.events.EventDispatcher;
        [Bindable]
        public final dynamic class PrefObj extends EventDispatcher {
            private static var _instance:PrefObj = new PrefObj();
            public function PrefObj(){
                if (_instance != null){
                    throw new Error("PreferencesManager can only be accessed through PreferencesManager.instance");
            public static function get instance():PrefObj {
                return _instance;
            //add your variables here:
            public var myString:String = "";  

Maybe you are looking for