HTML-DB OAE Javascript to close current window and open a new window

Hi everybody,
We work with 1.6.
What we want is to close the current window and open a new window with the URL mentionned in the window.open('http://www.cf.qc/pls/portal/PORTAL.....,'newwindow').
The new window opening fires only once although we call it many times.
Our javascript is:
function closeTest()
{ alert('closeTest');
if('&REQUEST.'=='QUITTER2'){     
w = window.self;
w.opener = w;
w.close();
window.open('http://www.cf.qc/pls/portal/PORTAL.home','newwindow','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
We call it on our application attributes :
OnLoad="closeTest()"
Thanks. Bye.

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

Similar Messages

  • When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs

    When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs
    == This happened ==
    Every time Firefox opened
    == Noticed yesterday, June27, 2010

    i just went into preferences, deleted what was in the home page, and entered a new home page address which solved the problem, 

  • When I have minimized additional windows and open another new window, the previously minimized windows show up underneath the new one, and I have to minimize them all again. This is quite annoying, how do you make it stop?

    This has only been happening since upgrading to Firefox 4.0.

    This issue can be caused by the ASK.com Toolbar.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Why do my animated themes only work the first time I open the window? Every one that I have tried stops animating if I close the window and open a new one.

    The headline pretty much sums up my problem. Basically, I picked a few different animated themes to try out in the Add-Ons section to personalize my browser window. They look great initially, and in the window that is open when I actually enable the theme. However, if I close that window and open a new one, the theme is stationary and no longer animates.

    Sorry......I was just too impulsive. ( Maybe because it was 4 AM at Taiwan, and I was still trying to solve the problem= = )
    Although to install the add-on "Personas Shuffler" can solve the problem to me, I don't think it was the BEST solution. This evening, I read why the add-on "Personas Shuffler" was made, and found that the BEST solution is:
    1. Open a new tab, and type "about:config" at the URL bar, then search for "lightweightthemes" with the filter.
    2. Change the values of "lightweightThemes.persisted.footerURL" and "lightweightThemes.persisted.headerURL" from true to false( by double click on them).
    3. After doing so, restart Firefox and you will see it works! You don't have to install any add-on.

  • SRW.SET_HYPERLINK - Handle SPACE in filename AND open in NEW WINDOW

    Report 10g (10.1.2.3.0 - 32bit on Windows 7 64bit)
    Issue #1:
    using srw.set_hyperlink to get a handle on *.pdf file on remote server. Report is launched as PDF. PDF that is opened via the URL launches in same window as report. I need run report as PDF, click hyperlink to get handle on another file which should launch in New Window.
    SRW.SET_HYPERLINKATTR only useful with HTML and HTMLCSS. Javascript? If so, sample code?
    Issue #2:
    possible that file retrieved will have spaces in its name. Hyperlink defaults %20 in the spaces of the name, but the link does not successfully retrieve file. Tried replacing spaces w/ %20, but like defaults does not retrieve document; due to actual file name not having the %20 in its actual name. Is there are way to account for the spaces in the URL then "remove" them to find the correct file and open in new window?
    Tried using virtual path as well as physical path.
    Help with either or both issues is truly appreciated,
    Thanks!!

    Hello,
    When you set the property "Hyperlink", the property "Additionnal Hyperlink Attributes (HTML)" is displayed. Set this property to :
    target="_blank"
    Regards

  • AF Table-CommandLink and Open in New Window issue

    I am using af:table to display the result set and inside the af:table i use af:commandLink to display the link to users. When the user clicks the individual link , user will go to the correponding detail page which is working fine.
    But the problem is if i right click the commandLink from the browser and click "Open in New Window" in IE or "Open Link in New Window" . it opens a new window and displays the same page instead the detail page.
    My requirement is when user click the link user should see the corresponding detail page - which is working fine now.
    But when user clicks open in new window from browser in the new window user should see the corresponding detail page. How do i accomplilsh this scenario.
    Any help would be highly apprciateable..

    Hi Frank, thanks for the quick reply. But if u think of the end user, most of user always right click and click open in new browser to see the details. so that they can stay the results page. ..
    Do you mean, any link navigation in ADF faces, dont work if we click "open in new window"?

  • Firefox opens the old browsing window (previous session) every time i try and open a new window, how do I change this back?

    Every time I go to open a new window, the old one will come up instead. For a while it was working fine, then I kept needing the old window and would use the 'restore previous session' feature to access this. However, even after I didn't need it anymore (and without me selecting the feature, it would still open the previous session.

    Tools > Options > General > Startup: "When Firefox Starts": "Show my home page" "Show a blank page"
    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js [2] and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    * [1] http://kb.mozillazine.org/Session_Restore
    * [2] http://kb.mozillazine.org/sessionstore.js

  • I can no longer hold down the Safari icon on the dock and open a new window

    I noticed after installing Snow Leopard that I am unable to hold down the icon for Safari on my dock and choose the option to open a new window. I have had to revert to (Command-Tabbing) through my open applications to get to Safari, then (Command-N).
    I found it much more convenient to do it the other way. Am I missing something, or is this something that has been removed with the new Snow Leopard operating system?
    Please help. Thanks!

    Thank you. What a pain though. Why would they make it a separate command now. It would be so easy to have kept it in the pop-up that shows when you hold the cursor down on it.

  • Open in New Tab and Open in New Window have switched places, how to revert?

    I was glad to find as i logged in today that Firefox had a update ready. I was even more excited when i learned that the browser itself has been updated. And while all these new and exciting things make Firefox an amazing choice for a browser, im at my wits end on this little change that is annoying the hell out of me.
    Apparently between 3.6 and the new Firefox, when you right click on a link, you see Open in New Window in the spot where Open in New Tab was. This may not seem like a big deal, but to a person who has been opening windows in tabs since tabbed browsing came out, i absolutely hate having multiple windows open.
    When i right click on a link, its an automatic reflex for me to open it in a new tab, but now i cant. Each time i end up opening a window instead. Is there an easy fix to this little problem that's driving me insane?

    Opening order of Tabs in 4.0.1
    To make TABS open to the right within each browser window in the same order as you opening them:
    What to do:
    Open a second window so you can read these instr.
    Enter "about:config" in URL address bar.
    Get a warning - 'Are you sure / advanced settings...blah, blah. '
    Click YES
    Scroll down the page until you find the described line:
    "browser.tabs.insertRelatedAfterCurrent"
    Find it a ways down, then right click on the line to then TOGGLE the menu pop-up option to "FALSE" DONE !
    It worked immediately, no need to restart.
    My tabs now all open to the right in order of them being opened.
    Nice.
    Thank you 'Platon' from a different Mozilla help site.

  • Keep focus in the same window after opening a new window per key-event

    I have an application in which user can press on a specific key, and that opens a new window in a JFrame. User might want open a few of such windows in a row by changing the cursor position and pressing the same letter key. But the problem is that with every new window Java VM transfers the focus to that new window. User is forced either to click to regain focus, or to move the mouse out-and-in the window, in which case the focus returns to it as well, assuming the X11 style of focus by cursor position of course.
    Is there any way to keep the focus with the window on which the cursor is placed?

    In your ActionListener your code should be something like:
    JFrame anotherOne = new JFrame();
    anotherOne.setVisible(true);
    originalFrame.requestFocusInWindow();If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://sscce.org], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Links browser and open in new window

    I have 2 problems with links and elinks. All time when I type "open in new window" it work but it open always in xterm, not in the same terminal I`m using at that moment for example mrvxt
    Second problem is that I can`t open new tab normal or in background in elinks or links-g
    Last edited by yellowfox (2008-03-20 19:39:16)

    I tried to change variable TERM in .bashrc  or in /etc/profile but I saw in console only
    Error opening terminal: mrxvt.
    When I set this variable to "xterm" I had`t see any message as above
    I read too some about infocmp, this commned show some info included in /usr/share/terminfo about terminals but I found only info about xterm
    infocmp Terminal
    infocmp: couldn't open terminfo file /usr/share/terminfo/T/Terminal.
    infocmp mrxvt
    infocmp: couldn't open terminfo file /usr/share/terminfo/m/mrxvt.
    infocmp xterm
    # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm
    xterm|xterm terminal emulator (X Window System),

  • Close current gui and open another?

    how can i close the current gui and then open another? what would be a suitable way to so? so far i do it using the following code but it does not close the current window and it takes a couple of seconds to load the other gui screen..
       private void btn_registerActionPerformed(java.awt.event.ActionEvent evt) {                                            
             Register Register_gui = new Register();
             Register_gui.setTitle("Login");
             Register_gui.setSize(467, 460);
             Register_gui.getSize();
             Register_gui.setVisible(true);// TODO add your handling code here:
             new Login().setVisible(false);
        }     

    Instead of new Login().setVisible(false); use dispose();This assumes that the event handler is a member of the frame you want to close. If not, you'll have to provide the handler with a reference.

  • JavaScript and "Open In New Window" not working.

    I've been using Safari 5 since it came out and there were no problems. But recently my JavaScript has stopped working. Whenever I click on a link that is supposed to run a script nothing happens. Similarly when I click a link that is supposed to open automatically in a new window, nothing happens. I've tried reseting Safari but that did not help. I had this same issue with Safari 4 and the update to 5 solved it, but now I do not know what to do.

    HI and welcome to Apple Discussions...
    From the Safari Menu Bar click Safari/Preferences then select the Security tab.
    Make sure Java is enabled.
    And, from a Finder window select your Home Folder in the Sidebar on the left. Then open the Library folder, then the Caches folder, then the com.apple.Safari folder. Move the cache.db file to the Trash.
    Relaunch Safari. If you still have problems, go to the Safari Menu Bar, click Safari/Preferences. Make note of all the preferences under each tab. Quit Safari. Now go to ~/Library/Preferences and move this file com.apple.safari.plist to the Desktop.
    Relaunch Safari and see if that makes a difference. If not, move the .plist file back to the Preferences folder. If Safari functions as it should, move that .plist file to the Trash.
    I had this same issue with Safari 4 and the update to 5 solved it, but now I do not know what to do.
    If nothing above helps, install the v10.6.4 Combo Update
    Then repair permissions.
    Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and *restart your Mac*.
    Carolyn

  • HTML Snippets and Opening in New Window?

    Hello,
    New to iWeb and this forum. Have been developing a site and I have been using an html snippet on one page. I would like to have that page open in a new window, therefore, I would like the link to that page to open the window. I know about the "check box" when creating links that makes this happen. However, as this is in the navigational menu on the top of the page, there isn't an option for this in iWeb.
    Can you help please? Thanks in advance.

    Koeklin,
    Thanks for the reply. I was trying to do this a different way, and I'm sorry if I haven't expressed myself clearly.
    I have been using Blogspot for a company blog. I wanted to incorporate this blog into my iweb site. However, I don't want to lose what I have already done in Blogspot (can this easily be transferred? I don't know).
    So what I was doing was this...
    I have on my site a page labeled "blog." When this link is clicked, I show, via html snippet, the blog from Blogspot, but because of how the snippet shows on my page, it does not show the menu at the top of the Blogspot page (which is what I would like). I'm trying to make the blogspot blog appear to be an original part of my site, even though it isn't. I was hoping to have this blog page open in a new window with the Blogspot blog present on my blog page. I'm pretty sure everyone is confused by now...
    Or, maybe to make things easier, is there a way to incorporate a "back" button on this page to go back to the site?
    I'm sorry if this is confusing....

  • How to post the data to a new window and control the new window's property?

    When we submit the form data to another page, we usually do the following:
    <form action="display.jsp" method="post"> will submit the form data and open
    display.jsp in the current browser
    <form action="display.jsp" method="post" target="_blank"> will submit the form data
    and open display.jsp in a new browser
    Now, what I want is to open display.jsp in a new browser, but control the window's size,
    and disable the status bar, title bar, and address bar of a new browser.
    If I do this, it can only open a html page, but not post the data to display.jsp.
    window.open('display.jsp', "newWin", "scrollbars=0,menubar=0,toolbar=0,location=0,status=0");
    any ideas? thanks!!

    <html>
    <head>
    </head>
    <script language="JavaScript">
        function doSubmit() {
           displayWindow = window.open('', "newWin", "scrollbars=0,menubar=0,toolbar=0,location=0,status=0");
           document.submitForm.submit();
    </script>
    <body>
    <form name="submitForm" action="display.jsp" method="post" target="newWin">
      <input type="text" name="param1"><br>
      <INPUT TYPE="button" NAME="button" Value="Click" onClick="doSubmit()">
    </form>
    </body>
    </html>

Maybe you are looking for