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

return value from RadWindow

2 Answers 180 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ryan Bartsch
Top achievements
Rank 1
Ryan Bartsch asked on 27 Jan 2010, 11:25 PM

Greetings,


First some background information:
I have a RadTextBox which accepts an employee id (if known). If the employee id is not known, there is a hyperlink button accompanying the RadTextBox, which opens up a search dialog in a RadWindow. In the RadWindow, the user can enter search criteria to filter a list of employees, which appear in a RadGrid. The leading field in the RadGrid contains a hyperlink that, when clicked, should do the following:
1. Close the RadWindow.
2. Set the value of the RadTextBox in the parent window.
3. Cause a postback in the parent window.

I’ve got most of it working, but have several questions.
1. Is it possible to set (via Javascript) the value of the RadTextBox in the parent window such that a postback would automatically occur (the RadTextBox specifies AutoPostBack=”true”)?
2. What is the correct way to set the input values associated to a RadTextBox? I was trying to use a generic solution that would work for other similar search dialogs; so I pass the Id of the RadTextBox through as a querystring parameter in the NavigateUrl attribute of the RadWindow. The following Javascript function is called when the RadWindow is closed (OnClientClosed attribute):

function onClientCloseLOV(oWnd, args) {

    var arg = args.get_argument();

    if (arg) {

        $get(arg.id).value = arg.value;

    }

}

Note: “arg.id” is the RadTextBox ID attribute in the parent window. The problem here is; if I subsequently click on the input field the value disappears!

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jan 2010, 11:48 AM
Hi Ryan,

You can try the following code in order to set the value for RadTextBox from client side in the OnclientClose event handler.

JavaScript:
 
     var textbox1 = $find("<%= RadTextBox1.ClientID %>"); 
      textbox1.set_value("value"); 

And use the following code for invoking postback from client code.

JavaScript:
 
        var textbox1 = $find("<%= RadTextBox1.ClientID %>"); 
        textbox1.raisePostBackEvent(); 

-Shinu.
0
Ryan Bartsch
Top achievements
Rank 1
answered on 31 Jan 2010, 11:45 PM
Thanks Shinu
Tags
Window
Asked by
Ryan Bartsch
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ryan Bartsch
Top achievements
Rank 1
Share this question
or