Passing data from child to radeditor

6 posts, 0 answers
  1. mike
    mike avatar
    2 posts
    Member since:
    Mar 2009

    Posted 03 May 2010 Link to this post

    Hi,

    I open  a traditional child window via javascript but I can't return data to my radeditor. I can successfully return to a textbox, but can't to the radeditor. I'm using window.opener.  


    I am using master pages as well.

    Thanks,


    Mike
  2. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 04 May 2010 Link to this post

    Hi Mike,

    Please, find attached an example demonstrating how to pass information from a window.open dialog to RadEditor.


    Best wishes,
    Rumen
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. mike
    mike avatar
    2 posts
    Member since:
    Mar 2009

    Posted 04 May 2010 Link to this post

    Hi,

    Thanks for the quick response.

    I ran your code as is and got this error: Unexpected call to method or property access. This occured on the click of the ok button when trying to set_html.

    When I tried to incorporate your code into mine the if didn't trigger. I had an alert in the else that executed instead.

    Child code
    <script language="javascript" type="text/javascript">  
    var oElement = window.opener.editor  
    function GetRowValue(val) {  
        //  ctl00$ctl00$ContentMain$ContentPlaceHolder1$cbExpectations$RadEditor1  
        alert(val);  
        //window.opener.document.getElementById('edExpectations').innerHTML = val;  
        //window.opener.document.forms['aspnetForm'].ctl00$ctl00$ContentMain$ContentPlaceHolder1$SID.value = val;  
        if (oElement) {  
            oElement.set_html(val);  
        } else {  
        alert("no if");  
        }  
           
        self.close();  
        return false;  
    }  
    </script> 

    Parent Code
    <script type="text/javascript">  
        var editorElement = null;  
     
    function OpenPopup() {  
        editorElement = $find("<%=edExpectations.ClientID %>");  
        window.open("../curric/curricpick.aspx", "CurricPick", "scrollbars=yes,resizable=yes,width=445,height=660");  
    }  
    </script> 


    Thanks again for your help,


    Mike
  4. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 06 May 2010 Link to this post

    Hello Mike,

    Is it possible that you use RadEditor Classic (RadEditor.dll) or an older Telerik.Web.UI.dll file?

    For your convenience I have attached a fully working project along with the Telerik.Web.UI.dll that demonstrates the required functionality.

    Sincerely yours,
    Rumen
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Suderson
    Suderson avatar
    18 posts
    Member since:
    Apr 2011

    Posted 24 May 2011 Link to this post

    I'm having a HTML button and a radEditor in a page.

    When I click my html button, am opening a window through Javascript. When I clik a row in the newly opened window, I want to display the selected Value in the RadEditor.


    I'm able to display value if all the controls are in the same page.

    Please help me.
  6. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 24 May 2011 Link to this post

    Hello Suderson,

    Steps to achieve the requested feature:
    1) Default.aspx:
    <telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>
    <script type="text/javascript">
    function invokeTopPageMethod(contentForPasteInRadEditor) {
       var editor = $find("<%=RadEditor1.ClientID%>");
       editor.set_html(contentForPasteInRadEditor);
    }
    </script>

    2) DialogPage.aspx:
    Execute the following line when you want to paste the content from the dialog in the editor

    <script type="text/javascript">

    window.top.invokeTopPageMethod(contentForPasteInRadEditor);

    </script>

    window.top returns the topmost browser window of the current window.

    All the best,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top