Using Apex 3.2
I have probably done this loads of times in my old job, but do not have access to the code and today I just can't get it to work properly.
I have opened a pop up window with javascript
Now I need to close it and refresh the calling page, but only if it passes the validation on the popup.
I have a hidden item on my pop up called P7_FLAG.
I have a page process after validation that sets P7_FLAG to (only set to 1, if passes validation).
I also have a SUBMIT button.
So once I click my SUBMIT button the page should look at the validations, if ok, set P7_FLAG to 1, then close the popup and refresh the calling page.
My current javascript look like this
<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
var test = $x('P7_FLAG').value;
if(test == '1')
{
window.close();
window.opener.doSubmit('REFRESH');
}
}
</script>
On my button
javascript:saveChanges();
The problem is that I need to click the SUBMIT button twice.
First time it sets P7_FLAG
Second time it closes page and refreshes.
I have probably made some basic error, but today I cannot see it.
Cheers
Gus
Edited by: Gus C on May 10, 2012 12:48 AM