I’m finding that a child window is not passing values back to its opener. Here are details:
The opener is an iframe on a $$ViewTemplate which is defined as follows:
An agent is called into the iframe by a button that’s defined on the $$ViewTemplate as follows:
The agent contains the following code:
Dim url As String
Print “”
A button on the child which should copy values to the opener runs the following function:
function copyToOpener() {
for ( i = 1; i < document.forms[0].elements.length; i++) {
var fieldName = document.forms[0].elements[i].name;
if (fieldName != null && fieldName != ‘’) {
opener.parent.frames[“agentFrame”].document.forms[1].elements[fieldName].value=document.forms[0].elements[i].value;
}
}
window.close();
}
Everything works fine except the ‘copyToOpener’ function. I’ve tried substituting “frameName” and ‘parent.parent’ in this function, but the JavaScript still fails.
The child was able to copy to the opener when the agent code was in a form action on the $$ViewTemplate (except parentWin.opener was set to ‘self’) and the following code was in the ‘copyToOpener’ function: opener.document.forms[1].elements[fieldName].value=document.forms[0].elements[i].value;
I’d appreciate any ideas on what changes might be required in the ‘copyToOpener’ function so that it can pass values back to its opener now that an iframe is being used to open the child.
Thanks.