Passing values from RadPopUp to Parent Page

2 posts, 0 answers
  1. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 13 Jun 2013 Link to this post

    hi,
    I have a rad window which opens on button click. It has many text boxes.
    I want to pass text boxes value to its parent page.
    I wrote this code in popup

     function returnToParent() 
                      {
                                         
                        var oArg = new Object();
                         oArg.txtRateType=document .getElementById ("txtRateType").value;
                    
                       
                        oArg.txtLabourWeekdayTotal=document .getElementById ("txtLabourWeekdayTotal").value;
                        oArg.txtLabourSaturdayTotal=document .getElementById ("txtLabourSaturdayTotal").value;
                      var oWnd = GetRadWindow();
     oWnd.close(oArg);
    }
    I m calling this funtion on submit button of this form.

    Then on parent page,i have defined

    <telerik:RadWindowManager ID="RadWindowManagerServiceReportDetails" runat="server" OnClientPageLoad="OnClientPageLoad"  Font-Names="Arial, Helvetica, sans-serif">
                <Windows >
                     <telerik:RadWindow ID="UserListDialogInvoiceWorksheet" runat="server"  Height="740px" 
                       Width="910px" ReloadOnShow="true" ShowContentDuringLoad="false" OnClientClose="OnClientCloseInvoicePopup" 
                       Modal="true" KeepInScreenBounds="true" Behaviors="Close,Move"  Font-Names="Arial, Helvetica, sans-serif" Font-Size="11 px" />
                </Windows>
        </telerik:RadWindowManager>

    so when radwindow closes,this function gets called





      function OnClientCloseInvoicePopup(oWnd, args)
     {
                 
                   var arg = args.get_argument();
                
                   if (arg) 
    {
    var  textBox = $find("<%=txtExitReportInvStandardDays.ClientID %>");
    textBox.set_value(arg.txtLabourWeekdayTotal); 

    var  textBox1 = $find("<%=txtExitReportInvPremiumDays.ClientID %>");
    textBox1.set_value(arg.txtLabourSaturdayTotal)); 

    }
    }

    but when if textbox is equal to null. and an error occurs 'null is null or not an object'.

    please help me this problme.

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 18 Jun 2013 Link to this post

    Hello,

    There is a viable answer in your other thread with the same content: http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/passing-values-from-radwindow-to-parent-page.aspx.
    You may also find useful this demo that shows the same approach: http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx.

    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top