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

Set text to combobox in 1. window from 2. window

1 Answer 40 Views
Window
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 03 Aug 2009, 07:54 AM
Hi,
in my case I have two radwindows.
In the first I have RadComboBox, and in the second I have a button with javacript functions.
In this function I want to set text to RadComboBox in 1. window.
I want to have only js code in the second window.
I'm trying to use code from sample DialogReturnValue:
                //get a reference to the second RadWindow         
                var dialog1 = oWnd.get_windowManager().getWindowByName("RadWindow1");         
 
                // Get a reference to the first RadWindow's content  
                var contentWin = dialog1.get_contentFrame().contentWindow  
                  
                //Call the predefined function in Dialog1  
                //contentWin.populateCityName(selectedCapital);  
                contentWin.$find("<%= RadComboBox11.ClientID %>"); //error  
 
but there is an error that RadComboBox11 doesn't exist.
I want to ask, is it possible to do something like this?

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Aug 2009, 08:31 AM
Hello Jaromin,

This error is expected - $find() will work only in the context of the page from which it was called - in your scenario, the RadComboBox is in the other window and that is why you are getting this error.
I suggest to put that last line of code in a function in your other page (e.g. where the RadComboBox is) and then to call it by using contentWin.MyFunctionName(some_argument) - just like shown in the commented line in your code.

Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
wnl
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or