I have a Javascript function that opens a radwindow and then tries to call a function in that window. It seems liek this should be pretty easy, but I can't get it to call that function. Here's the calling function:
function openNewWindow(agentID, contractID, company)
{
var tabs = tabStrip.get_tabs();
var tabval = 0;
var tabFound = false;
// loop through the tabs looking for existing agent
for (var i = 0; i < tabs.get_count(); i++) {
tabval = tabs.getTab(i).get_value();
if (tabval == agentID) {
tabFound = true;
var oWnd = tabs.getTab(i).correspondingWnd;
break;
}
}
// if agent is already open, alert user and don't open again
if (tabFound == false) {
var oWnd = radopen("AgentWin.aspx?HeaderID=" + agentID, null);
oWnd.set_title(agentID);
oWnd.maximize();
tabStrip.trackChanges();
//create a new tab
var tab = new Telerik.Web.UI.RadTab();
//set the text of the tab
tab.set_text(agentID);
oWnd.correspondingTab = tab;
//add the tab to the tabstrip
tabStrip.get_tabs().add(tab);
tabStrip.repaint();
tab.correspondingWnd = oWnd;
tabStrip.commitChanges();
//Select this tab
tab.select();
oWnd.get_contentFrame().contentWindow.CallContractsWindow(agentID, contractID, company);
}
}
Since I open the radwindow in this function, I already have have the reference to it (oWnd), so I thought I could just use that last line to call a function in the opened window. But that last line gives me - "Error: Object doesn't support this property or method"
Can anyone tell me what I'm doing wrong? Thanks!
function openNewWindow(agentID, contractID, company)
{
var tabs = tabStrip.get_tabs();
var tabval = 0;
var tabFound = false;
// loop through the tabs looking for existing agent
for (var i = 0; i < tabs.get_count(); i++) {
tabval = tabs.getTab(i).get_value();
if (tabval == agentID) {
tabFound = true;
var oWnd = tabs.getTab(i).correspondingWnd;
break;
}
}
// if agent is already open, alert user and don't open again
if (tabFound == false) {
var oWnd = radopen("AgentWin.aspx?HeaderID=" + agentID, null);
oWnd.set_title(agentID);
oWnd.maximize();
tabStrip.trackChanges();
//create a new tab
var tab = new Telerik.Web.UI.RadTab();
//set the text of the tab
tab.set_text(agentID);
oWnd.correspondingTab = tab;
//add the tab to the tabstrip
tabStrip.get_tabs().add(tab);
tabStrip.repaint();
tab.correspondingWnd = oWnd;
tabStrip.commitChanges();
//Select this tab
tab.select();
oWnd.get_contentFrame().contentWindow.CallContractsWindow(agentID, contractID, company);
}
}
Since I open the radwindow in this function, I already have have the reference to it (oWnd), so I thought I could just use that last line to call a function in the opened window. But that last line gives me - "Error: Object doesn't support this property or method"
Can anyone tell me what I'm doing wrong? Thanks!