:: Forum >>

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
Monday, August 29, 2005
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
Monday, August 29, 2005
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
Tuesday, August 30, 2005
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
Tuesday, August 30, 2005

This topic is archived.


Back to support forum

Forum search