cancel
Showing results for 
Search instead for 
Did you mean: 

regarding pop-ups

Former Member
0 Kudos

Hi all,

I am opening a pop-up from my main page by window.open.

On the pop-up there is a YES button and a NO button.

When I click on YES button I want to replace the calling page at the background of the pop-up by a new page..i.e. I want to open a new page in the same browser instance as the calling page, and close the pop-up.

I tried doing window.open(new_page) at the YES button and then window.opener.close to close the calling page. But that obviously opens the new page in a new browser instance. I donot want that. I want to have the new page in the same browser instance as the parent page of the pop-up.Please help me. Thanks in advance.

Regards

Ananya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try

    var p_win = window.self;
        p_win = p_win.opener;
        p_win.location.href="new.htm";
        window.close(); 

Former Member
0 Kudos

Hi Gladson,

Thanks a lot.It is working fine. But another issue is cropping up.

I am calling a server side event from the pop-up before closing it.Now,what is happening is,the pop-up is refreshing the background with the new page and closing itself without going to the server side event. How can I sort this out ? Please help.

Thanks&regards

Ananya

Former Member
0 Kudos

Is there any relation netween the page being loaded on the parent window and the server side event?

If No,

Replace the window.close command with ->

1. set a hidden form field with a flag

2. Submit the form using forms.submit

3. In On Input Porcessing of the Pop up, read the hidden field and if the flag is set, do your server side event.

4. Again in the layout, if this flag is set, call window.close

Former Member
0 Kudos

Hi Gladson,

The pop-up is going to itsonInputProcessing using statement htmlbsl..There is a relation between the page being loaded and the server side event.

Regards

Ananya

Former Member
0 Kudos

Then, call this script

var p_win = window.self;
        p_win = p_win.opener;
        p_win.location.href="new.htm";
        window.close();

during the second round. That is, on clicking the Yes, submit the form and in the onInputProcessing, set a flag and on the layout, check the flag and then execute the above code.

Former Member
0 Kudos

Hi,

Thanks a lot. It is working fine now.

Regards

Ananya

Answers (0)