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

element parent node is null for radwindow

1 Answer 107 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gajanan
Top achievements
Rank 2
Gajanan asked on 13 Sep 2010, 05:09 AM
hello,

my problem is, i am using the radgrid in that i am showing the status of each row (it is a hyperlink)
on click of status i am showing the radwindow in that i have option to change the status for that row.
on rad window i have 2 buttons Save and close on on save i am saving the status in database and redirecting to the parent page
while redirecting it should refresh the parent page and update the status of that row.
even on close button i want same ,

but now it is refreshing the page only first time when i open the radwindow and closed it but after i want to change the status of second row i am getting the jscript error "element parent node is null" and "Object doesnot support property or method" after this idid some changes,
i used  DestroyOnClose="true"  then it is showing the
 
my code is below on Parent page
i using the
<telerik:RadAjaxPanel ID="rjxPanel_PurchaseOrder" runat="server"
                    LoadingPanelID="RadAjaxLoadingPanel1" Width="100%" Height="100%" >
<tr>
        <td>
            <div id="RestrictionZone" class="module" style="margin-top: 4px; height: 300px; width: 400px;">
                    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" style="z-index:7001">
                        <Windows>
                            <telerik:RadWindow runat="server" ID="RadWindow1" ReloadOnShow="true"
                                ShowContentDuringLoad="true" Modal="true"
                                Height="560px" Width="620px" NavigateUrl="ManagePurchaseOrder.aspx"
                                Animation="Fade" />
                        </Windows>
                    </telerik:RadWindowManager>
            </div>
        </td>
        </tr>
function ChangeStatus(OrderID)
        {
           var EntityID =document.getElementById("ctl00_ContentPlaceHolder1_HiddenField_EntityID").value;
          // window.showModalDialog('ManageStatusChange.aspx?EntityID=' + EntityID + '&EntityType=PurchaseOrder&EntityKeyID='+OrderID , this, "status:no;help:no;overflow:auto;center:yes;dialogWidth:775px;dialogHeight:675px");
           var PopupWindow=radopen('ManageStatusChange.aspx?EntityID=' + EntityID + '&EntityType=PurchaseOrder&EntityKeyID='+OrderID , "RadWindow1");
           PopupWindow.Center();
        }
function refreshParent(arg)
        {
             //Get reference to RadAjaxManager on page  
            if (radManager == null)       
            var radManager = $find('<%= RadAjaxManager.GetCurrent(this).ClientID %>'); 
            //Fire ajax request (optionally pass an event arg value)
            radManager.ajaxRequest(arg);   
        }
in parentAspx.cs
#region RadAjax CodeBlock
 
        RadAjaxManager rjxManager = RadAjaxManager.GetCurrent(this);
        //Create a new delegate to handle the AjaxRequest event  
        rjxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(rjxManagerPurchaseOrder_AjaxRequest);
        rjxManager.AjaxSettings.AddAjaxSetting(rjxManager, rjxPanel_PurchaseOrder);
 
        #endregion
#region Rad Ajax Event
 
    protected void rjxManagerPurchaseOrder_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            Session["currentObject"] = null;
            RadGrid_Orders.Rebind();
        }
    }
 
    #endregion


and another page which will show in radwindow

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">  
 
 function GetRadWindow()
  {
       var oWindow = null;
             
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
             
            return oWindow;
   }
 
function closeRadWindow()  
{
 
    GetRadWindow().Close();    
}  
 function CloseAndRebind(args)
 {
      GetRadWindow().Close();
      GetRadWindow().BrowserWindow.refreshParent(args);
 }
 
</script>  
</telerik:RadCodeBlock>

and on close button :-
<asp:Button ID="btnClose_Top" runat="server" Text="Close"            
                        OnClientClick="javascript:closeRadWindow();return false;" />

and on save button

string script = "<script>CloseAndRebind('Rebind')</" + "script>";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "CloseAndRebind", script, false); 


PlZ plz tell the solution

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 14 Sep 2010, 03:35 PM
Hello Gajanan,

Please take a look at the Window Editing demo to see how the desired functionality can be implemented.

I hope this helps.

Regards,
Mira
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
Tags
Ajax
Asked by
Gajanan
Top achievements
Rank 2
Answers by
Mira
Telerik team
Share this question
or