function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chamil MadusankaChamil Madusanka 

close the child pop up and refresh the parent page

Hi All,

 

I have created a visualforce page with outputLink component for get a popup page.

 

 

<apex:repeat value="{!node.children}" var="child">
   <li><span>{!child.name}</span>&nbsp;
   <apex:outputLink value="/a07/e?retURL=%2Fa07%2Fo8&parent={!child.id}&CF00N90000001xlPo={!child.name}" target="_blank">Add</apex:outputLink>
</apex:repeat>

 This URl in output link is contain a standard page(It is for insert new employee). I want to close the child page and refresh the parent page after click save button in child page.

 

How can I do this?

 

 

Thanks in Advance

--

Chamil Madusanka

 

bob_buzzardbob_buzzard

I think this one could be a struggle.  Typically browsers like the page that opened the popup to close it, which means that you need to somehow trigger the close from the save.  However, as you are in a standard page you won't be able to communicate with the VF page that opened the popup to make that happen.

aboussaidiaboussaidi

I thing that you can perfom this with JavaScript, you proced like that :

 

1- create a JS action wich show the pop window :

 

var m = showModalDialog(URLChild, "", "status=yes; scroll=no; help=no; unadorned=yes");

2- In child pop up you have 2 buttomn :

 

first ADD second Cancel :

 

if add :

function oui(){
    window.returnValue = true; 
    window.close();
}

if cancel :

function oui(){
    window.returnValue = false; 
    window.close();
}

 

 

And in the parent page you add :

  var urlResult= sforce.apex.execute("Ctrl201TestExtelia","Init",{});
    var m = showModalDialog(urlResult, "", "status=yes; scroll=no; help=no; unadorned=yes");
    if(m==true){ 
      refresh document
        }else{ 
          do something
            }
   }

 

 

 

 

 

 

aboussaidiaboussaidi

Test it and if you have a problem contact me

Chamil MadusankaChamil Madusanka

Hi,

 

Child page is a standard page. So how can I add the javascript in that standard page?

aboussaidiaboussaidi

Well you :

 

1 your name/setup/Customize/you standard object 

    Task Buttons and Links

 

in the page you : 

Custom Buttons and Links 

click NEW 

 

and you complete name .... and in the Behavior you select Execute Java Script

Chamil MadusankaChamil Madusanka

Hi ,

 

Here this standard page is  from a custom object. I fount the place of custom Buttons and Links. But I cannot understand how to put the javascript .

 

 

aboussaidiaboussaidi

in the behavior you specifie that is a execute java Script 

 

Behavior : Execute JavaScript  View Behavior Options

 

 

and on bouttom you write you java script code