简体   繁体   中英

Close Parent Tab after closing of child tab

 ====================Apex Class Code========================
Public Boolean isClosed{get;set;}
isClosed = false;
List<Opportunity> Affre_main = new List<Opportunity>();
for(Opportunity opp: [select id,Afree_main_sol__c from Opportunity where Id in: oppVar] ){
        opp.Afree_main_sol__c = 'some value';
        Affre_main.add(opp)
}
if(!Affre_main.isEmpty()){
    insert Affre_main;
    isClosed = true;
}

========================ON VF Page=================================================
<script>
if("{!isClosed}"){
    window.close();
    //Now how to close its parent tab//
}

</script>

I am looking for a workaround. I want to close a tab (say child tab) and then I want to auto-close the parent (main tab).

Is there any standard way then please tell me.

I want to use this solution with visualforce-salesforce.

Javascript/jquery solutions will also be helpful.

I find it myself.

just a quick line solution.

Just need to use window.opener.close(); to auto close the parent window from the open child window.

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