Returning data from RadWindow in SharePoint

3 posts, 0 answers
  1. Russ
    Russ avatar
    27 posts
    Member since:
    Oct 2008

    Posted 08 May 2009 Link to this post

    I have an application in SharePoint that contains a RadGrid whoe edit item calls a RadWindow to get some external information.  This works fine when I run through testing in my visual studio environment, but as soon as I move it it's SharePoint home, it no longer returns the data.   The main page with the RadGrid works fine, it calls the RadWindow fine (and everything in it works as expected), but once I hit the submit button, the RadWindow just closes and the data does not seem to go back to the Parent Window.  

    Ive based my code on this demo, and a various other links within the documentation that I can't fnd atm.   Is there something different that needs to be done for the values to be returned to the parent window in SharePoint?  

    I'll try to give the main pieces of code blow:
    First, from the main form:  the RadWindow declaration:
            ID="RadWindowManager1" ShowContentDuringLoad="false"    
            VisibleStatusbar="false" ReloadOnShow="true" runat="server">  
                <telerik:RadWindow ID="RadWindow1" Width="350px" Height="450px" Title="Choose Assignees" 
                    Behaviors="Close" OnClientClose="OnClientClose"   
                    NavigateUrl="/UserControls/ProposalTasks/PeoplePickerDialog.aspx" Modal="True">  

    The field within the RadGrid that needs the data (note the inner Javascript is storing these clientIDs in an array for easy access) :
    <telerik:GridTemplateColumn HeaderText="Assigned To" UniqueName="ASSIGNED_TO"   
                                SortExpression="ASSIGNED_TO" DataField="ASSIGNED_TO">  
                                     <script type="text/javascript">  
                                         registeredTbAssignedElements.push('<%# Container.FindControl("rtbAssigned").ClientID %>');   
                                     <telerik:RadTextBox ID="rtbAssigned" runat="server" Rows="1" Columns="50" 
                                            Text='<%#Bind("ASSIGNED_TO")%>' TextMode="MultiLine" > 
                                     <asp:Button ID="btnGetNames" runat="server" Text="^" /> 
                                    <asp:Label ID="lblAssignees" runat="server"   
                                        Text='<%# Eval("ASSIGNED_TO") %>'></asp:Label> 

    The JavaScript related to the RadGrid on the arent page:
    <script type="text/javascript">  
        //global DOM ID registry for our rtbAssigned control.  filled up by scripts rendered from template fields.  
        var registeredTbAssignedElements = [];  
        // Rad Window functionality (for selecting assignees)  
        function openWin(radindex) {
            var tbAssignedclientID = registeredTbAssignedElements[radindex];
            var currText = $get(tbAssignedclientID);
            var oWnd = radopen("/UserControls/ProposalTasks/PeoplePickerDialog.aspx?rowIndex=" + radindex + "&currentText=" + currText.value, "RadWindow1");
        function OnClientClose(oWnd, args) {
            //get the transferred arguments
            var arg = args.get_argument();
            if (arg) {
                var radIndex = arg.indexID;
                var assignees = arg.assignees;
                var existingAssignees = $find(registeredTbAssignedElements[radIndex]);

    The entier RadWindow Page that is called and it's Javascript:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PeoplePickerDialog.aspx.cs" Inherits="Proposal_Tasks.UserControls.ProposalTasks.PeoplePickerDialog" %> 
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
    <html xmlns="" > 
    <script type="text/javascript">  
        function GetCurrentItemRequesting(sender, eventArgs) {  
            var context = eventArgs.get_context();  
            context["FilterString"] = eventArgs.get_text();  
        function GetRadWindow() {  
            var oWindow = null;  
            if (window.radWindow) oWindow = window.radWindow;  
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
            return oWindow;  
        function returnToParent() {  
            //create the argument that will be returned to the parent page  
            var oArg = new Object();  
            // get the Row ID  
            var textRowID = document.getElementById('txtRowID');  
            //get the names  
            var textbox = document.getElementById("<%=rtbStart.ClientID %>");   
            oArg.indexID = textRowID.value;  
            oArg.assignees = textbox.value;  
            //get a reference to the current RadWindow  
            var oWnd = GetRadWindow();  
            //Close the RadWindow and send the argument to the parent page  
            if (oArg.assignees) {  
    <head runat="server">  
    <body > 
        <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" /> 
            <fieldset id="fld1" > 
                <legend style="text-align:center" >Choose Assignees</legend> 
                <div style="margin: 5px 0 10px 0px; text-align:center;" > 
                     <telerik:RadTextBox ID="rtbStart" runat="server" Rows="3" Columns="35" 
                            TextMode="MultiLine" > 
                    <telerik:RadComboBox ID="rcbAssigned" Runat="server" AccessibilityMode="True"   
                        Width="250px"  MaxHeight="225px" ShowMoreResultsBox="True" EnableLoadOnDemand="True"   
                        AutoPostBack="True" > 
                    <WebServiceSettings Method="ListADUsers" Path="/UserControls/WebServices/WSADUsers.asmx" /> 
                    <input id="txtRowID" type="hidden" runat="server" /> 
            <div style="margin-top: 4px; text-align:right;">  
                <button title="Submit" style="margin-top: 26px;" id="close" onclick="returnToParent(); return false;">  
    and that page's code behind, as it does a little bit of the setup work (although I don't think it's related to the problem).:
           protected void Page_Load(object sender, EventArgs e)  
                if (!IsPostBack)  
                    if (Request["currentText"] != null)  
                        rtbStart.Text = Request["currentText"];  
                    if (Request["rowIndex"] != null)  
                        txtRowID.Value = Request["rowIndex"];  
            protected void rcbAssigned_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
                string newval = rcbAssigned.Text;  
                // add the selected user to the listing  
                string textboxValue = rtbStart.Text;  
                if (textboxValue.Trim() == "")  
                    textboxValue = newval;  
                    textboxValuetextboxValue = textboxValue + "; " + newval;  
                rtbStart.Text = textboxValue;  

    I know it's a lot of code to digest at once, but I need help here.  As I said, all works perfect in the Visual Studio environment, but as soon as I move it to SharePoint the return variables don't work.   Anyone have any idea whats happening?


  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 11 May 2009 Link to this post

    Hello Russell,

    I examined your code and it seems to be correct. It is also strange that it works on a separate page but it does not in SharePoint. What I can suggest is to debug the client code and see whether all of it is executed.

    In case this does not help, I suggest to provide a live url where I can examine the setup and research what might be causing the problem.

    All the best,
    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.
  3. Russ
    Russ avatar
    27 posts
    Member since:
    Oct 2008

    Posted 11 May 2009 Link to this post

    Unfortunately I can't provide a live URL because we only work within our Intranet behind a firewall. For the time being we have decided to put this functionality on hold (due to timing constraints on the project).  I'll try to revisit this later and give an update.

Back to Top