Refreshing Parent Window on Close of Child Window

I need to open a new popup window/tab using window.open method of javascript and on close of the new tab/popup window have to return some values from closing window to parent window. When I open a popup suing window.open in my asp .net application which is supposed to be compatible with iPad. Value has successfully been returned when I use IE, Chrome, FireFox and Safari (on PC with windows 7).
Unfortunately the same code fails in Safari when I access the application through iPad. On iPad domObject is prompted on new window open instead of prompting returned value on new window close.
Below is the code. Parent Window:
Parent Window:
<script type="text/javascript">
        function modalWin() {       
                retVal = window.open('About.aspx', 'name', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
                alert(retVal);
    </script>
//HTML
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<a title="Test New Popup" onclick="modalWin();">New Popup for all browsers.</a>.
</asp:Content>
Popup window or new tab:
    <script type="text/javascript">
        function closeIt(tempValue) {
            window.returnValue = tempValue;
            window.close();
    </script>
//HTML:
<input id="btnButton1" value="btnButton1" type="button" title="Press it to Close" onclick="closeIt('btnButton1');" />
    <br />
    <input id="btnButton2" value="btnButton2" type="button" title="Press it to Close" onclick="closeIt('btnButton2');" />
    <br />
    <input id="btnButton3" value="btnButton3" type="button" title="Press it to Close" onclick="closeIt('btnButton3');" />

HI for your reference
am opening the new window by using
<i><b>page navigation property</b></i> in that I am setting the
Launch a new window  :   display in seperate window
now if i close the main window ie potral screen i want the window which is opened through this also to be closed
regards
Abhijith YS

Similar Messages

  • Refreshing Parent.jsp and forwarding to Child.jsp

    Hi
    I have a parent.jsp where I provide criteria to query and export the data to excel. If the resultset is null I forward to parent.jsp with error message, but if there is data I forward to child.jsp.
    If in the first attempt there is no data and display of error message in parent.jsp and in the subsequent second attempt I change the selection criteria and get the data report in excel format, but the error message displayed in parent.jsp for the earlier transaction remains the same i.e. parent.jsp should ideally refresh and then forward to child.jsp.
    Currently I am using the following code and controlling it with a script that is called on click of submit i.e. I set the text (error text) value to null. Is there a better way to achieve this? Kindly help
    <%if (error != null) {%>
    <table>
    <tr>
    <td>
    <input type="text" name="errorMsg"
    style=" color:red; font-size: 8pt; FONT-FAMILY: verdana, helvetica;font-style: TT; border:'0'; font-weight: Bold"
    value='<%= error %>'
    size="141" readonly="readonly"/>
    </td>
    </tr>
    </table>
    <%}%>

    Thanks a lot frndz.. for your reply.. but both ways I tried its not working ..Devendra I went thru the code given there in the link but it couldn,t work... I tried for window.opener.refresh(). In spite of refreshing the parent jsp and getting the pop up closed ,it displayed the the refreshed parent JSP in the pop up window. keeping parent JSP intact..
    Any other alternative can anyone advise... :)

  • How to Close Multi Child Windows : ADF Swings - Urgent

    Hi,
    I have developed a application having Login , Filter , Master , Details , and Detail Screen . In the Filter Screen If i click on button called " CLOSE CHILD WINDOW " , all the screens ( Master , Details And Summary ) to be closed .
    Can u please let me know how can i do this .
    For even Child Window to open from parent Window , i have implemented same piece of code from adfwhitepapers docs.
    private void jButton1_actionPerformed(ActionEvent e) {
    SalesOrderDetails salesOrderDetails = new SalesOrderDetails();
    salesOrderDetails.setBindingContainer(createDetailBinding(salesOrderDetails));
    DCIteratorBinding iterBinding = getPanelBinding().findIteratorBinding("SalesOrderEOVO1Iterator");
    RowSetIterator detailAccessor = iterBinding.getRowSetIterator();
    salesOrderDetails.getPanelBinding().findIteratorBinding("SalesOrderEOVO1Iterator").bindRowSetIterator(detailAccessor, false);
    salesOrderDetails.setVisible(true);
    int count = 0;
    private DCBindingContainer createDetailBinding(SalesOrderDetails salesOrderDetails)
    String detailBCName = "SalesOrderDetailsPageDef"+count;
    if (panelBinding.getBindingContext().get(detailBCName) == null)
    DCBindingContainerDef bcdef = DCBindingContainerDef.findDefObject("oracle.eaton.userinterface.pageDefs.SalesOrderDetailsPageDef");
    DCBindingContainer bc = bcdef.createBindingContainer(panelBinding.getBindingContext());
    bc.setName(detailBCName);
    panelBinding.getBindingContext().put(detailBCName, bc);
    ++count;
    return bc;
    return null;
    Regards
    Bhanu Prakash

    I have referred this link for the consecutive opening and closing screen for the linkage between the two screen like 1&2 , 2&3 , 3&4 , that was my understanding if so not can u please explain me . My requirement is to close all the child windows from the Super Parent Window , i.e. on Select of close button in Filter Screen all the screen ( Master,Detail,Summary ) should be disposed or close ,
    I have generated 4 screens :::
    1. Filter Screen
    2. Master Screen
    3. Detail Screen
    4. Summary Screen
    Can any one help me by giving there solution to sort out this issue . Its very Urgent .
    Regards
    Bhanu Prakash

  • How to make the parent window inactive when a child window is opened

    hi everybody, i am chaitanya. i am working on a window based application. there are some action events in it. when an event occurs then a child frame is opened prompting the user to confirm for yes or no.
    the problem i got is, when the child window is opened the parent window is also active. I dont want this to happen. please help me to fix this problem.
    thank you all in advance, have a nice day.

    Use a modal JDialog, or better still given the apps. requirement for input, a JOptionPane. The JOptionPane.showInputDialog() or JOptionPane.showConfirmDialog() methods seem well suited to the task.

  • Window.opener  property from child window to parent window

    Hi
    When communicating between the child (popup) window to the parent window works fine as long as we pass the static reference to the window.opener
    Example :
    Main Page
    form name = staticform
    input name = col1
    Popup Page
    javascript :
    window.opener.staticform.col1.value = some value
    How can I use a dynamic reference for the staticform.col1 in the window.opener property to post the value back to the parent window ?
    thanks for the help
    sarma

    Actually, I think tolmank's would work... I've done basically the same thing before, but more like this (if it's generic, it's a good idea to have checks for the things being in existance). This is something I used in a generic color chooser I wrote in Javascript. Had multiple fields in one form using it for selecting different foreground/background colors.
    <%
    String form = request.getParameter("form");
    String fgfield = request.getParameter("fgfield");
    String bgfield = request.getParameter("bgfield");
    %>
    vfnSet = function() {
       if(typeof(window.opener) == 'undefined' || window.opener == null) {
          return;
       if(typeof(window.opener.document.forms['<%= form %>']) == 'undefined') {
          return;
       var oForm = window.opener.document.forms['<%= form %>'];
       if(typeof(oForm.<%= fgfield %>) == 'undefined') {
          return;
       if(typeof(oForm.<%= bgfield %>) == 'undefined') {
          return;
       oForm.<%= fgfield %>.value = document.forms['colorform'].foreground.value;
       oForm.<%= bgfield %>.value = document.forms['colorform'].background.value;
    }

  • How to refresh parents externally changed collection of child objects

    Hello,
    we have an external process which updates the database independently from TopLink. We receive a notification whenever objects are created or deleted.
    We have an object A that contains a collection of B's. When a B is inserted or deleted in the database, we get an insert- or delete-event for B. But we also need to refresh the object A to reflect the changed collection in our object model.
    Is there any TopLink mechanism we can use to do this automatically? Otherwise we will have to manually find all the objects that reference the inserted or deleted B and refresh them as well.
    We are grateful for any suggestions.

    Hello Don,
    thank you for your answer. We have the back reference and at the moment follow the approach you suggested. But as a consequence we have to handle each class B individually, i. e. given our knowledge of the object modell we have to hand-code for each class B a method that refreshes all the objects referring to it. Since the necessary information to do this seems to be available in the TopLink descriptors we were wondering whether there exists a more generic way. E. g. we thought about analyzing B's descriptor and follow all one-to-one mappings to the referred objects and find out if their descriptors in turn contain a collection mapping to B in which case we would refresh them. Unfortunately that won't work in case of n:m mappings where no back reference exists.
    Another possibility would be to go over the TopLink cache and refresh every entry that refers to the object in question, but we do not know how this could be done (and if it is advisable).
    Best regards
    Achim

  • Move data from Child window textbox to Parent window Mainwindow WPF

    I'm trying to take what's in a textbox in the child window to the textbox in the Parent window and close the child window...? any links or  a code example to help please
    Thank you in advance

    Hi
    Create a Main window with a button and a child window with a text box in it and try to use this code in the main window
    namespace WpfApplication
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    ChildWindow childWindow;
    string CaptureMessageFormChildWindow;
    private void button1_Click(object sender, RoutedEventArgs e)
    childWindow = new ChildWindow();
    childWindow.Show();
    childWindow.Closed += (s, args) => MessageBox.Show(childWindow.textBox1.Text);
    CaptureMessageFormChildWindow = childWindow.textBox1.Text;
    //Now you can use the data captured form the child windows
    The complexity resides in the simplicity Follow me at: http://smartssolutions.blogspot.com

  • How to close child windows when parent window closed in jsp

    how to close child windows when parent window closed in jsp
    becoz it can't be able to recognise it's parent
    with the whole application
    plz send me some sample code of it

    Hi, I have no idea how to do this is JSP.
    However createing a modal window (with javascript) would mean that the user can not use the parent window untill he closes the child window. However not sure if this is what you are searching.
    Otherwise you can detect the onClose (I think) and close the window from there.
    However both the above are JavaScript and not JSP.
    rwgards,
    sim085

  • Problem refreshing the parent page when closing a modal window.

    I have page that opens a modal window from a report link column. In the modal window I want to be able to make my changes and press an Apply button so that the modal window is closed and the parent page is refreshed to show the modified details in the report. In Firefox all works well but in IE I get the error message ‘Window.opener.location is null or not an object’ .
    When I comment out window.opener.location.href=window.opener.location.href; the modal window closes without error but I want to refresh the parent page with changes made in the modal window.
    I’m afraid my java script is very limited (the code is based on other peoples examples.)
    Parent Page I call this function from a report link column to display a modal window. Sets the hidden SAVE_STATUS field in destination page to ‘N’
    function modalWin(pshow)
    var url;
    url='f?p=&APP_ID.:'+pshow+':&SESSION.::::SAVE_STATUS:N';
    if (window.showModalDialog) {
    window.showModalDialog(url,"name","dialogWidth:650px;dialogHeight:700px"); }
    else {
    window.open(url,"name","height=700,width=650,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    Destination page (modal window)
    HTML Header.
    The function closeWindow should refresh the parent page and close the modal window.
    <base target=_self>
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    function closeWindow() {
    if ( document.getElementById("SAVE_STATUS").value == 'Y' )
    window.opener.location.href=window.opener.location.href;
    window.close();
    //-->
    </script>
    Html Body attribute.
    onLoad="closeWindow();"
    P_UPDATE_DATE process called from the Apply changes button. Sets the SAVE_STATUS flag to ‘Y’ for the onload in the html body.
    UPDATE event
    SET event_date = :P5001_EVENT_DATE
    WHERE contract_reference = :P330_EVD_CONTRACT
    AND event_number = :P330_EVD_EVENT_NUMBER;
    :SAVE_STATUS := 'Y';
    Thanks in advance, I will have a look when back in the office on Monday.
    Cheers Pete

    Hi Chris,
    Thanks for your help. I think I've sorted it using your first suggestion doing a refresh in the parent page, I just didn't know how at the time.
    What I've got in the parent window after the call to the modal window is the reload window.location.reload(); and in the modal window I close it using window.close(); The down side being the refresh happens if I use my 'Apply changes' or 'Cancel' button but I can live with that for now.
    It seems to work in IE and firefox but as I say most of what I'm doing is cobbling together using other peoples code without really understanding exactly what it does. Anyway thanks for your help, sound like I should look into JQUERY when I have time.
    Thanks Pete
    Parent window call to modal
    function modalWin(pshow)
    var url;
    url='f?p=&APP_ID.:'+pshow+':&SESSION.::::SAVE_STATUS:N';
    if (window.showModalDialog) {  window.showModalDialog(url,"name","dialogWidth:650px;dialogHeight:700px");                                          }
    else {
    window.open(url,"name","height=700,width=650,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    window.location.reload();
    Modal Window Close.
    window.close();

  • Session expiration issue with parent and child window

    Hi,
    We have two applications (App1 - Implemented using JSF, Spring and Hibernate and App2 -Implemented using Spring MVC, Spring JDBC).
    I have implemented 'Test Access Content' functionality in App1.
    First admin user (Role- Manager) needs to login to App1
    As part of 'Test Access Content' functionality, he enters URL with encrypted key and click 'Test Access' button.
    It opens new window (implemented using java script - window.open) and hits spring controller of App2.
    In spring controller of App2, I am decrypting the key to get user details. After that i am setting user details in session, constructing final URL to display actual content.
    Problem is parent window maintains session till child window renders response. Once child window renders response, parent window loosing session.
    So, if i click any button in parent window after child window renders response, it displays login page as there is no session for parent window.
    Please note that App1 and App2 are sharing same domain. only context paths are different for both apps (app1 and app2).
    Any suggestions on this issue are much appreciated. Please let us know if you have any questions.

    Hi,
    When you open a child window from parent window then you can access child data in the parent window through javascript.
    We have a main web page. There are quite many links on it from which >user can open new web pages but the data is saved when the submit >button on the main page is clicked. Also data that user entered on the >other sub pages is not displayed in the main window.
    1 is this a case of parent and child window.case 1 When you are submitting the main page you need to run javascript function and get data from child windows and save that to database or session. next time when you are displaying the main window you need to query session or database to display the child window data in the main window.
    Case 2> closing child window and you need data in the parent. This can be done in two ways.
    1> When you are closing the child window populate some variables of the main window using javasript.
    2> Save the values in the database or session and refresh the main window and extract data from database or session
    Where should the data be saved that user enetered on the sub pages as the data is not shown in the main page - should it be stored in the session?It is design decision. You can store data in either session or database when you are closing the child window. But ifyou are saving the data on the main page then you can populate main page with child windows data using javascript. Save the data t database when main window data is saved. Depends on business requirements.
    In short if you are saving child windows data in session or database then you need to refresh main screen to pull that data otherwise populate main screen using javascript.
    I hope i answered your questions :) best of luck

  • Parent child window functionality using CFM

    In .cfm page I am trying to implement the following
    functionality
    I got a parent window contains a button.
    On button click a child window should get open.
    This child Window should get embed in that parent window
    (like MDI application)
    1)i.e While minimizing the parent window this child window
    should also get minimized
    2)While closing the parent window this child window should
    also get closed
    3) We should also be able to close the child window alone.
    4) If you double click on the title bar of the child window
    it should get maximized
    5) Again double click on the title bar of the child window it
    should get minimized.
    I tried with <embed> tag but it seems its for audio ,
    flash kind files.
    If we can use <embed> tag means whats should be the
    value of the "Type" attribute.
    waiting for your valuable information

    Window handlers and controls are generally a function of the
    browser and not really manipulatable using ColdFusion, as it runs
    on server-side only, not client-side. JavaScript would be more the
    thing to play with in this regard, although I don't think there is
    an "onClose" event handler.
    HOWEVER!
    All browsers have a security feature that prevents pop-up
    child windows from "hijacking" their parents window behaviors,
    including resizing, moving, changing the toolbars, closing, etc.
    This security feature cannot be bypassed, and is an integral
    hard-coded aspect of all modern browsers. I suspect that what you
    are looking to do may be impossible due to this one fact, unless
    someone knows a bypass.

  • How to close child windows at logout?

    I was wondering how i can ensure that when a user loggs out,
    any related open child windows from that session are automaticaaly
    closed. The Application is written in ASP VBscript.
    Basically the user can logout two ways, either by clicking on
    the logout link or by closing the browser window. For the latter
    what i did was to create an even for the "onUnload" event of the
    browser. So when the user closes the window, it will also logg the
    user out.
    Now i also wanted to automatically close any child windows
    that the user may have opened when he either loggs out or closes
    the browser window. How can I accomplish that without prompting the
    user that the window is about to close?
    B.T.W. I use the
    window.open method to open the child windows, using either
    javascript or vbscript.

    Hi, I have no idea how to do this is JSP.
    However createing a modal window (with javascript) would mean that the user can not use the parent window untill he closes the child window. However not sure if this is what you are searching.
    Otherwise you can detect the onClose (I think) and close the window from there.
    However both the above are JavaScript and not JSP.
    rwgards,
    sim085

  • Communicating between the parent and child windows in Struts

    Hey,
    I would like to know what is the best way to communicate between the child and parent windows on a struts based web application. For example i have a struts based jsp page. I call a child window from this page. On the child window i select few values and they have to be shown on the parent. What is the best way to achieve this in struts.
    Thanks
    in advance.
    KM

    The only way to do this without Javascript is to have the child window have a form and the form has a target defined as the name of the parent window (how to name it without using frames or having it open from another window, I'm not sure), and when you submit the form, it'll submit to the parent window/frame and you can process that form on the server and return the same parent page with the selected values.
    Otherwise, you need Javascript to set form values to "window.opener" from the child window.
    Either way, it's not really a Struts thing, technically.

  • IPad Safari IOS 5 window.close() closing wrong window

    When I want to close the child window(although now they open as tabs) in the parent window with javascript window.close(),the parent window was closed.
    Is this a bug or have any solution?
    Safari/7534.48.3
    My script:
    <script type="text/javascript">
      var subWin1 = null;
      function popSub() {
        subWin = window.open('myurl,'subWin1','height=200,width=200'); 
      function closeSub() {
        subWin.close();
    </script>

    I'm having the exact same problem.  On iPad Safari on iOS 5 attempting to close a popup window with close() is causing the parent window to close instead.  Every other browser, including iPhone Safari on iOS 5 it works fine.  I've been trying to come up with a workaround but haven't found anything yet.  If anyone can find a workaround please post.

  • Portal session still exist in child window after logout main window

    Hello community,
    here's a short summary about our business scenario:
    We use performance management (SAP HCM) within our SAP ERP 6.0 and SAP NW Portal 7.0.
    With the application performance management we use some bsp- and webdynpro-iviews from the business package MSS.
    Some of these applications opens a second portal window (child windows) for doing the work.
    If the user logoff only the main portal windows with the "logout"-link and also close this window (e.g. he forgot to close the child windows) the user have the possibility to make changes (e.g. in the opened performance management document) in the child window.
    This behavior isn't allowed according our company principles. If the user logout on any portal window (also at creating of new portal sessions with STRG+N) all the sessions of the user should be terminated.
    Which possibilites do I have to solve this problem?
    Thanks for your help!
    Kind regards,
    Bernd

    Hello,
    yes, I found a solution.
    In the iView-parameter you can put in the following value:
    PortalSessionID = <ClientWindowID>
    This value ensures that in the opend window no changes are possible.
    In the opend child window there is now a pop up to log on to the ERP-system.
    Kind regards,
    Bernd

Maybe you are looking for