Close popup, do process and refresh parent page
565262Jul 19 2007 — edited Sep 5 2007Hi,
I have a parent page which shows data based on several collections. On the press of a button it opens a popup page which allows the user to edit the data in one of the collections. When the user clicks on the 'Save changes' in the popup I would like it to (1) update the collection; (2) close the popup; (3) refresh the parent page to show the newly modified data. The problem is, while I can get all three of these actions to work independently, I can't get them to work together.
To close the popup and refresh the parent page I can call the javascript function 'passBackAndSubmit' (which I found on the forum, see below) by putting in the Optional URL redirect part of the 'Save changes' button properties. To update the collection I call a process after submitting the page.
function passBackAndSubmit()
{
opener.document.wwv_flow.p_request.value = 'REFRESH_AFTER_POP';
opener.document.wwv_flow.submit();
close();
}
I think what is happening is that once the javascript is called it bypasses the process updating the collection. I have tried to overcome this in two ways:
(a) putting the javascript into a page branch to URL rather than on the 'Save changes' button' so that the collection is updated first
(b) moving the 'update collection' process into the parent page so that it calls it when loading (i.e. on the refresh). I've checked the session state and the item values from the child page are still present.
I don't understand why either of these solutions do not work. Please can somebody explain what is happening behind the scenes and a possible solution.
Thanks
Lucy