Close browser window on click  - pass parameter

Hi,
I have two applications (iViews) in the portal, one passing parameter to the other. On click of 1st iView, it passes parameters to 2nd iView, which opens as a separate window in portal. I need to select some values in it and on clicking OK, some parameters should be passed to the 1st IView and the window must be closed. The parameter must be made available in the 1st Iview, by autorefreshing.
Srinivasan T

Hi,
I try this and it is work fine
This solution for IE7 & IE8
<af:resource type="javascript">
     function closeBrowser() {
         window.open('', '_self', '');
         window.close();
</af:resource>
<af:commandButton text="Close Browser" id="cb1" immediate="true">
      <af:clientListener method="closeBrowser" type="action"/>
</af:commandButton>Sameh Nassar

Similar Messages

  • Getting hang/crash problem when I try to close browser window from applet

    I have a small Apllet that has a button that calls a Javascript function in the opening window, to close the window in which it is loaded.
    The Applet window is a PopUp window from one of my application's window. First time I start my application and load that Applet the button works fine. It calls the Javascript method and the Method closes the window using the self.close() method.
    But now if I open the applet window again and click on the button to close the windows, it hangs. I put in trace statements and saw that it hangs on JSObject.getWindow() window.
    I am using JDK Plugin 1.4.2_07 and 5.0 , if I work out on IE browser, it works fine.But when I use firefox or mozilla it gives problem of hanging/crashing.
    Note that in case of 1.4.2_07 this problem experienced some times but in case of 5.0 it gives always for other than IE browser.
    Please, if somebody could give me some clue about why this would happen, I will really appreciate that. and code related to this is given below
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet implements ActionListener{
    protected JButton closeButton = null;
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    this.closeButton = new JButton("Close Browser Window");
    this.add(this.closeButton);
    this.closeButton.addActionListener(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    alreadyClosed = true;
    TestApplet.this.stop();
    frame.show();
    public void actionPerformed(ActionEvent ae){
    stop();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    frame.dispose();
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    Thanks.

    I am waiting for any reply. I have tried for all these below options still I am getting Problem. I heard this is because of javascript, it wont call methods more times .Thats
    why I need other than JSObject or java script solution.If some one know anything about this or any modifications I have to made for the below options to avoid that problem please let me know.
    // URL durl = new URL(thisObject.getCodeBase(), "test/CloseMe.htm");
    // System.out.println("URL :" + durl.toString());      
    // thisObject.getAppletContext().showDocument(durl);
    //     thisObject.getAppletContext().showDocument(new URL("javascript:window.close();"), "_self");
    //win.eval("top.opener=self;top.close();");
    //win.call("close", null);
    //Object[] args = { "close", new Integer(50) };
    // win.call("setTimeout", args);
    //win.eval("setTimeout("close", new Integer(50));");
    If it is the problem of JRE I just need it should work on 1.4.2_01 or higher.
    thanks.

  • Close browser window using FPM

    Hi all,
    My requirement is to close the browser window on click of a button in the webdynpro component.
    I have triggered  FPM event gc_event_close in after action of that view.
    The window gets closed perfectly if I execute the application from SE80.
    But the window is not getting closed when I run the application from portal, instead I get a message saying' The application is closed, you can now close the window'
    Any pointers on closing the browser window when the application is run from portal would be of great help.
    Thanks in advance.
    Veda

    I can confirm this behavior. You can change this behavior by adding code in process_event method.
    1. Fire a portal event with
    "urn:com.sapportals:navigation", "CloseWindow", ""
    OR
    1. Fire a Exit plug with close_window = abap_true
    [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/ca3351508f04e7e10000000a42189c/frameset.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/ca3351508f04e7e10000000a42189c/frameset.htm]

  • How to close browser window after user log out

    Hi,
    Does anyone know how I can close browser window after user logs out. The scenario is when user clicks a log out button I will invalidate user session and close the browser right away in the backing bean.
    Your help would be appreciated.

    Try run this and you'll see that it runs fine with no exceptions:
    <%
         String someText = "bla bla bla";
         response.setContentType("text/plain");
         response.setHeader("Content-Disposition", "attachment;filename=message.txt");
         try {
              ServletOutputStream os = response.getOutputStream();
              os.write(someText.getBytes());
              os.flush();
              os.close();
         } catch (Exception e) {
              out.println("ERROR: " + e);
    %>It looks like that after I've closed the outputStream I can't do any more processing in the JSP. Even if I remove the setContentType and setHeader methods it still behaves this way.
    I'm starting to think that there's no way around this...??

  • Close dialog window by clicking on 'X'

    Hi
    I am displaying a dialog window that allows the user to modify data.
    When the user clicks on the 'Cancel' button I have placed on the window, the action code fires and the return listener fires.
    I have added some java script that executes the following command when the user closes the dialog by clicking on the close icon.
    submitForm("groupCaptureForm",0,{source:"cancelGroup"});
    Basically simulating a click on the 'Cancel' button.
    For some reason when the user closes the window by clicking on the close icon, the action code fires, but the return listener code never fires.
    Any idea why?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Express install always asks user to close browser window

    Is Adobe in charge of the code that closes browser windows at
    the end of express install?
    I'm currently using SWFobject 1.5 to embed my flash movie
    with express install active and neither IE6, IE7 or firefox will
    automatically close once express install has finished. It used to
    be that IE would close and reopen the window, firefox never used to
    but that's a different topic I'm sure.
    Perhaps Adobe changed something?

    Never mind, found the answer here:
    Re: Closing brower window

  • Close Browser window when you close 10g forms

    Help Please.... I am trying to close browser window when I exit 10g forms:
    Per oracle Note:115905.1
    create close.html file Put the html file in the webserver root.
    I created the following file in $ORACLE_HOME/Apache directory (webserver directory??)
    1.)Create an html file (es. close.html):
    <html>
    <body onload="closeit()">
    <script>
    function closeit()
    win = top;
    win.opener = top;
    win.close ();
    </script>
    </body>
    </html>
    In exit form when button pressed I have the code
    web.show_document('http://apphost1.univ-wea.com:7777/close.html','_self');
    The brwser window does not close automatically.
    thanks,
    Anitha

    Hello this is saras from chennai.
    Now i m developing oracle forms using 6i. now i m running it independantly. that is i put forms in one folder and run these forms using shortcut. If i m using the same in client machine also. But now i want to run these forms in webbrowser(client-server). for this i done the followings.
    1. installing forms server and reports server.
    2.Also i install IIS Server and appachie server also.
    3. I had fmx files.
    now i dont know the procedure to configure these web server with forms server. And i hold the fmx files in inetpub\wwroot folder.
    Which one is the easy method appachiee server or iis server.
    Please help me to run these fmx files in web browser.
    I m eagerly waiting for your favourable reply.
    saras,
    [email protected]
    chennai

  • Click button to close browser window

    What javascript can I use with a button to close the browser
    window without poping up a window asking the user "Do you want to
    close this window?"

    Welcome to our community, Yohanski
    See if the following link helps.
    Click
    here
    Cheers... Rick

  • Opening New Browser window for click event on an image

    hi all,
    I want someone to help me out solving the problem of opening
    a new browser window on the mouse click event of an image or a
    button etc.... The new window would contain the datagrid details
    from the main window, but in an expanded form. If at all there is a
    solution, I even want to know whether there is anyway for sizing
    the poped up window,because I dont want the new poped up window to
    cover the entire screen.
    For getting better idea of my problem, the best example I
    could give is the popup window that appears when we click on the
    preview button while posting the message to the forum.
    Someone please do help me out in this regard.
    Thanks,
    amar.

    I'd definitely try to use a Flex popup... but the
    flash.net.navigateToURL method is a simple way to open a popup
    window in a new browser. You can pass any data needed by the new
    page using the URLRequest and/or URLVariables. The URL you navigate
    to could, of course, be another Flex application if necessary. I
    use this only when I need to open a popup window on another site,
    or an HTML formatter report or something similar.
    Concerning yourself with the size of the popup window may be
    a bad design choice also. I, for example, have my browser
    configured to open all popups in a new tab regardless of sizing
    constraints imposed by the designer. If it is absolutely necessary
    for you to have control over the size of your popup window, you
    should follow the advice given by others and use a Flex
    popup.

  • Webdynpro for ABAP not closing browser window after click Exit

    Hi Experts,
    We come across a minor problem when executing a Webdynpro for ABAP on our Production Portal.
    We have a "Exit" button which suppose to close the browser window with the webdynpro codes called but it failed to do so.
    The execution steps of the Webdynpro app:
         Click  "Exit"
         Click  "No"
         Results message in the browser:
    The code we use to exit and close the Web Dynpro application
    * Code to close the application when the WebDynpro is executed
    * as an independent application
    * Also requires an Outbound Plug (GO_EXIT) in the main Window
      data : lr_ref      type ref to ig_main_window.
      lr_ref = wd_this->get_main_window_ctr( ).
      lr_ref->fire_go_exit_plg( close_window = abap_true ).
    What would be the issue causing this, the Webdynpro codes or Portal config?
    Our systems are SAP NW 7.31 with:
    ECC6 (Basis 731 SP10)
    Portal (Basis 1000.7.31.7.0.20130227234100)
    Thank you for your help & advise.
    Derek Phung

    Hi Tashi,
    Thank you for your quick response & help.
    According to your more info link, the check will return ABAP_TRUE as the webdynpro app is ran on Portal.
    Sorry i should have mention that I got it working on our Dev & Test portal but now forgotten how i have done it, we now need it config for our production portal. I have vague memory collection that i config it somewhere on the portal, maybe one of the Application Modules in NWA?
    Any advise, help, hints would be very much appreciated.
    Thank You & regards,
    Derek

  • How to close browser window after flushing a file to the browser?

    I have this simple JSP, which flushes a String to the browser as a file (message.txt). The JSP gets opened in a new window when the user clicks a link.
    The problem is that after the JSP has run, the browser window won't close automatically. I've tried adding a small javascript to achieve this, but i doesn't seem to even get run.
    How can I close the browser window after the JSP has run?
    <%
         String someText = "bla bla bla";
         // Flush to browser
         response.setContentType("text/plain");
         response.setHeader("Content-Disposition", "attachment;filename=message.txt");
         try {
              ServletOutputStream os = response.getOutputStream();
              os.write(someText.getBytes());
              os.flush();
              os.close();
         } catch (IOException e) {
              return;
         } catch (Exception e) {
              return;
    %>
    <script type="text/javascript">
         window.close();
    </script>After the JSP has run, an empty html page with the following source can be seen:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
    <BODY></BODY></HTML>

    Try run this and you'll see that it runs fine with no exceptions:
    <%
         String someText = "bla bla bla";
         response.setContentType("text/plain");
         response.setHeader("Content-Disposition", "attachment;filename=message.txt");
         try {
              ServletOutputStream os = response.getOutputStream();
              os.write(someText.getBytes());
              os.flush();
              os.close();
         } catch (Exception e) {
              out.println("ERROR: " + e);
    %>It looks like that after I've closed the outputStream I can't do any more processing in the JSP. Even if I remove the setContentType and setHeader methods it still behaves this way.
    I'm starting to think that there's no way around this...??

  • Close browser window of mozilla Firefox with popup message in ADF

    below code is working in "Internet Explorer " browser but I want to excute this on "mozilla Firefox" browser with popup message when I click on browser cross Cancel button in ADF. Please help me how can I achieve this ?
    <af:resource type="javascript">
    function closeWindow(event){
    window.opener = self;
    window.close();
    </af:resource>

    Hi,
    thats not possible...
    you can't close the parent browser window(except IE).. you can only close the window that is opened by you... with window.open('');

  • Close browser window from webdynpro

    Hi
    Is it possible to close a brower window on click of a button in webdynpro
    Thanks
    Murali

    launch an asp page to accomplish a task.You can use the URL object in Java, this will make the http request to the asp page sharing the browser's cookie (in IE and Moz on windows).
    If the applet needs to make a connection to antother server than the one the applet came from you might be in trouble. You have to sign the applet or the user needs to set up a policy for it.
    Signing your applet:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post
    Posting data:
    http://javaalmanac.com/cgi-bin/search/find.pl?words=url+post

  • Can't find a java script that will close browser window

    I went through the archives and found several java scripts
    for closing browser windows. Unfortunately none of the work. If I
    find one that will work on a Mac - Safari then it won't work on a
    PC - IE. I downloaded and installed that extension but cannot find
    it on my Mac menus. Running MX2004 on a Mac.
    Here are the codes I've tried and a example page:
    <a href="#" onClick="window.close()">close
    window</a>
    <a href="javascript:window.close();">{YOUR TEXT
    HERE}</a>
    <a href="javascript:window.close()">Click here to close
    this
    window</a>
    <a href="javascript:self.close();"> close window
    </a>
    Here's an example of a non working page:
    [removed to protect the company]
    and another script that doesn't work:
    [removed to protect the company]
    Thanks for all your help.

    phrarod wrote:
    > I came here to learn. It was a simple thing and I was
    embarrassed that I forgot
    > how to do it. I mentioned that. I thanked Alan. My
    friend owns that company.
    > He's trying to help me out. He's a great guy and helps
    people alot. He doesn't
    > rip anyone off or pay them a pittance. He doesn't do a
    ton of web work because
    > as you said its harder and harder to get any money since
    clients have to be
    > educated why they need you when they can get it for free
    or $300 or a couple
    > hundred. We're all trying to make a living. If someone
    helps me I want to repay
    > that help if I can. I know I'm not paying for the advice
    here and since its in
    > a forum I don't know about I can't help technically.
    Networking is always a
    > good thing. I tried to help by offering a lead. How do
    you know this person
    > doesn't pay much? Because of me? Rather than following a
    lead you just assumed.
    > I know a lot about print and TV. I'm trying to fill out
    my skill-set to offer a
    > wider range of services. End of rant. I'm just hurt I
    was stepped on as it
    > blind-sided me. I have a solution. If its so basic it
    upsets the people who
    > answer then don't answer.
    >
    Don't feel offended, the comments weren't directed at you,
    rather at the
    bizarre world of web design.
    :-) We need to hang tough and help each other, whether we're
    working
    for a decent salary, for a pittance, or for our middle-aged
    aunt.
    Bonnie
    in California
    8 ^ )

  • Close Browser Window with view button element when view embedded into fpm

    Hi,
    is it possible to build a button into a component view which is embedded into a fpm to close the browser window?
    tried to build a exit plug within the view/window of my component. But nothing happened. the window stays open
    Maybe is it an option to fire the fpm close plug of the fpm from my component view embedded into the fpm?
    Hope you can help me.
    Using the close button of the fpm is not an option because the window should automaticaly close when clicking on a button embedded into my component view.
    Kind Regards
    Rico

    Hello,
    one more question.
    Is it possible to change the method. so that the fpm opens within the same browser window instead of a new one?
    Maybe is there a solution with the portal?
    This is the Method to create a new Shopping cart. This opens a new browser window.
    method /SAPSRM/IF_CLL_DOM_SCW_FIN~CREATE_NEW_SHOPPING_CART.
    data:
           LV_TASKCONTAINER      TYPE REF TO /sapsrm/if_cll_task_container,
           ls_obn_components     type /sapsrm/s_wd_ui_obn,
           lo_navigation_service TYPE REF TO /SAPSRM/IF_CH_WD_NAVI_SERV.
    try.
      LV_TASKCONTAINER = mo_parent_bo_mapper->get_task_container( ).
      CALL METHOD lv_taskcontainer->GET_NAVIGATION_SERVICE
        RECEIVING
          RO_NAVIGATION_SERVICE = lo_navigation_service.
      ls_obn_components-obn_system = 'SAP_SRM'.
      ls_obn_components-object_type = 'sc'.
      ls_obn_components-operation = 'shop'.
      CALL METHOD LO_NAVIGATION_SERVICE->LAUNCH_TARGET
        EXPORTING
          IV_TARGET_TYPE          = /sapsrm/if_ch_wd_navi_serv_c=>gc_target_type-obn
          IS_OBN_COMPONENTS       = ls_obn_components
          IV_OBN_PARAM_CLASS      = /sapsrm/if_ch_wd_navi_serv_c=>gc_param_class-taskcontainer
          IV_OBN_PARAM_METHOD     = 'GET_OBN_PARAMETERS_RM'
      catch /SAPSRM/CX_PDO_ERROR_GEN.
    endtry.
    endmethod.

Maybe you are looking for

  • IPhone wont show up in iTunes

    So i have brand new Windows 7 installed, also installed iTunes 9.2. I connect my iPhone to PC and it shows up in Windows. iTunes freezes for a while and then there is no iPhone. iTunes simply cant see my iPhone after unfreezing himself. Windows still

  • XA490AA Headset Microphone Not Working

    OP system; windows 7 - 64 bit. So i purchased a XA490AA in August this year, the sound quality is perfect and I am very pleased with the purchase however.... When first setting up my headset for the first time I remember using my microphone on skype

  • What happened to the option to buy your entire wish list in the iTunes Store?

    There use to be a "purchase your entire wish list" option in the iTunes store. So instead of buying 12 songs one at a time for $0.99 each, you could make one purchase for $11.88. That option appears to have been removed, or hidden. At least I can't f

  • Question about Sky Sports F1

    Hello, I am a big formula one fan and watch via the sky sports f1 channel however due to the sky price hikes & finances in general something has to give and with the rest of the sports channels not getting watched its been decided that the sports pac

  • How can I avoid browser timeout when starting a Plsql procedure from Apex?

    I start a procedure when pressing a button in my Application Express form. This procedure take a while to run (about 10 min.) How can I avoid the browser to timeout with Error Code 1460: Timeout ? Is it possible to return to a page and let the proced