This is a migrated thread and some comments may be shown as answers.

RadWindow post values to parent page

1 Answer 252 Views
Window
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 09 Apr 2011, 01:06 AM

Hello,

I'm having an issue posting values from a child window RadTextBox to the parent window RadTextBox. I can successfully post the value if I use an <input> tag on the parent page but when I swap it for a <asp:TextBox> or <telerik:RadTextBox> the javascript breaks with error "Microsoft JScript runtime error: 'valCity' is null or not an object. Take a look at the code below:

Parent Page:

 

 

 

 

function openDialog()
{
radDialog1 = radopen("DataMigration_Dialog1.aspx", "RadWindow1");
}
<telerik:RadButton ID="rb_Migrate" runat="server" Width="150px" 
Text="Migrate Accounts" EnableEmbeddedSkins="false" BackColor="#33393E" 
ForeColor="White" OnClientClicked="openDialog" AutoPostBack="false">
   
</telerik:RadButton>
   
<br />
</asp:Panel>
   
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableEmbeddedSkins="false" >
   
<Windows>
   
<telerik:RadWindow ID="RadWindow1" runat="server" Height="450" Width="240" Behaviors="Close, Minimize, Maximize, Reload" Modal="true" >
   
</telerik:RadWindow>
   
</Windows>
   
</telerik:RadWindowManager>
   
<asp:TextBox ID="City1" runat="server" ></asp:TextBox>
   
<%--<input type="text" id="City" value="Hide" runat="server" />--%>
<asp:TextBox ID="ParentCity" runat="server" ></asp:TextBox>
   
<asp:TextBox ID="TimeZone" runat="server" ></asp:TextBox>
   
<asp:TextBox ID="DMSVendor" runat="server" ></asp:TextBox>
   
<asp:TextBox ID="DMSUsername" runat="server" ></asp:TextBox>

Child Page:

function submit()
        {
            valCity = parent.document.getElementById("City1");
  
valCity.value = document.getElementById("modalCity1").value;
  
self.close();
               }
City:
    <br />
        <telerik:RadTextBox ID="modalCity1" runat="server" EnableEmbeddedSkins="false" Width="200">
        </telerik:RadTextBox>
  
  
<telerik:RadButton ID="RadButton1" runat="server" Text="Submit" 
            EnableEmbeddedSkins="false" Skin="WebBlue" ButtonType="StandardButton" 
            BackColor="#CCCCCC" OnClientClicked="submit" >
        </telerik:RadButton>

 

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Apr 2011, 06:28 AM
Hello Coley,

RadWindow provides the properties and methods for the communication between the parent and child window.
Take a look at the following documentation for more on this.
Using RadWindow as a Dialog

When you are trying to access the Ajaxified control the better approach is to use the $find method.
var nxt = $find("<%=modalCity1.ClientID %>");

Thanks,
Shinu.
Tags
Window
Asked by
James
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or