简体   繁体   中英

refresh parent window on closing of child window

i am new in struts developing a Java EE application in struts 1.3 i have a requirement that i have a form has got button on clicking it child window opens which contains services to be given . user will select services from the java script popup window which will display all the services with every service i have a check box .user will check those check boxes against the services which is to given and will press save button on java script child window and those selected services will display on the parent window in a table format my problem is that how to do this? and more thing that if user has suppose selected 5 services and has saved on javascript child window and has been displayed to parent window but now out of 5 services he selected if user want to remove 1 service out of 5 services and want to save only 4 services how this is to be done .or this can be done without using java script child window. and help would be appricated.

When you open a window with window.open, you get a reference on that window and you can check the 'closed' property as so :

document.getElementById("myButton").addEventListener("click", function(e) {

    var winref = window.open("about:blank");

    (function() {

        if (winref.closed)
        {
            alert("The window is closed");
        }
        else
        {
            setTimeout(arguments.callee, 40);
        }

    })();

}, false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM