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

Refresh parent page after window selection

1 Answer 96 Views
Window
This is a migrated thread and some comments may be shown as answers.
russellwight
Top achievements
Rank 1
russellwight asked on 10 Feb 2009, 01:11 PM
Here is my objective:  I have a RadTextBox that opens a RadWindow when it receives focus.  The RadWindow contains a RadGrid, which allows the user to select a row.  Upon selection, the RadWindow closes and returns an a variable to the parent page.  I then take the id that is returned, run a query to get a string value and place that string value in the RadTextBox.  Everything is working fine until I try to put the string value in the RadTextBox.  I can get the return value from the RadWindow and even place it in a label (see below).
function refresh(id, name) {  
                var lblEmployeeId = document.getElementById("<%= lblEmployeeId.ClientID %>");  
                lblEmployeeId.innerHTML = id;  
                var rtbFirstName = document.getElementById("<%= rtbFirstName.ClientID %>");  
                rtbFirstName.value = name;  
                  
            } 

The page will display the value for lblEmployeeId when the RadWindow closes, but not for rtbFirstName.  However, if I click in rtbFirstName, the value will be displayed.  I need it to display the same way as the lblEmployeeId.  Please advise.

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 11 Feb 2009, 12:30 PM
Hello wight4256,

You need to get a reference to the RadTextBox object with $find() -  getElementByID will return the hidden input only. After that you can set the value with the set_value() method:

var rtbFirstName= $find('<%= rtbFirstName.ClientID %>');
rtbFirstName.set_value(name);


Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
russellwight
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or