Description of Application:
Application page has a radlistbox on one pane on page and a radeditor on other pane on same page. When user clicks on a list box item the radeditor is saved and different content is loaded into radeditor depending on item selected in radlistbox.
Configuration of Application:
Application has a site.master which resides the radajaxmanager. The problem occurrs in a conent page
Description of Problem:
Radeditor does not change when set server side as a result of a client side ajax request.
Description of events:
I catch the radlistbox change client side on a selection_changed event and send an ajax message to server (
radManager.ajaxRequest(PassedArgument) )
along with a unique identifier indicating what the new radlistbox item that was selected.
Ajax message from javascript is caught server side (RadAjax_AjaxRequest) side with no problem. Editor is tested for "dirtyness", saved if it is dirty. Then the editor content is set according to the value selected in the radlistbox. Again no problem, and server side I can see that editor.content has changed in the debugger. The problem is the editor does not change in the gui. If I make a responseScripts call to get the value client side (editor.get_html();) it is still set to it's old value.
Code Snippets:
Site.Master
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
onajaxrequest="RadAjaxManager1_AjaxRequest_SiteMaster">
</telerik:RadAjaxManager>
Content Page, code behind, page load
protected
void
Page_Load(
object
sender, EventArgs e) {
...
RadAjaxManager manager = RadAjaxManager.GetCurrent(
this
);
manager.AjaxRequest +=
new
RadAjaxControl.AjaxRequestDelegate(RadAjaxManager_AjaxRequest_Editor);
...
}
Content Page, client side, listbox selection change
function RadListBox_ManualList_OnCleintSelectedIndexChanged(sender, args)
{
...
SendAjaxMessage(
"RadListBoxSelectionChanged-"
+ item.get_value());
}
Content Page, server side, catch ajax message
public
void
RadAjaxManager_AjaxRequest_Editor(
object
sender, AjaxRequestEventArgs e)
{
...
/*
* force rad edior content change for test
*/
RadEditor1.Content =
"hello world"
;
string
MyScript =
"test();"
;
RadAjaxManager.GetCurrent(
this
).ResponseScripts.Add(MyScript);
}
Content Page, client side, test()
function test(){
editor = $find(
"<%=RadEditor1.ClientID %>"
);
var test = editor.get_html();
//debugger here would show content not changed, also visable in gui
};