3.2.0

Returning the values of a selected row to another window

I have made a popup window that includes a AW grid on it. I would like the grid to send the values in two of the columns of the selected row to another window (who incidently called the popup window).

row.setEvent("ondblclick", function(){this.action("selectRow")});
obj.setAction("selectContact", function(src){
    window.opener.document.forms[0].elements['field1'].value = myData[src.getProperty("item/index")]['0'];
}


But the JS responds with Access Denied.
Neil Craig
August 29,
when you pop up the second window, are you using absolute or relative path information for the page that loads? And are you calling it modal or non-modal?
Jim Hunter
August 29,
It is non-modal, but the reference to the form on the other window is wrong. The AW grid is an Iframe, thus I have to build a reference from the Iframe to its parent and then a reference from the parent to the original window that called the popup.
Neil Craig
August 30,
I have learned that using:
row.setEvent("ondblclick", function(){this.action("selectRow")});
obj.setAction("selectRow", function(src){
    alert(parent.location);
}

will yield the address of the popped up window. But when using:
row.setEvent("ondblclick", function(){this.action("selectRow")});
obj.setAction("selectRow", function(src){
    alert(parent.opener.location);
}

will result in JS reporting 'Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMWindowInternal.alert]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://localhost/project/popup.jsp :: anonymous :: line 238" data: no]'
Neil Craig
August 30,

This topic is archived.

See also:


Back to support forum