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

popup problem when launching multiple times

3 Answers 154 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniel Tharp
Top achievements
Rank 1
Daniel Tharp asked on 30 Jun 2009, 05:34 PM
Hello,

I have a RadWindowManager on my page and a linkbutton popping open the window. The code is set properly and it works the first time you click the link but if you close the modal and try to click the link again it gives a javascript error of "Object doesn't support this property or method". My example is below.

 

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">    
     <Windows>          
<telerik:RadWindow ID="AddPersonnel" runat="server" Title="Create New Personnel" Height="375px" Width="625px" ReloadOnShow="true" Modal="true" OnClientClose="refresh" Behavior="Close, Reload" /> 
     </Windows>      
</telerik:RadWindowManager> 
   
 
<script type="text/javascript">     
    function AddPersonnel()  {    
        window.radopen("/Portal/Modal/AddPersonnel.aspx", "AddPersonnel");      
        return false;    
    }     
</script> 
   
 
this.lnkCreatePersonnel.Attributes.Add("href", "#");      
this.lnkCreatePersonnel.Attributes.Add("onclick", "return AddPersonnel();"); 

I have also tried it using the following:

<a href="#" onclick="AddPersonnel();">Create Personnel</a>

I can't seem to fix this issue and I've tried multiple. Help would be much appreciated.

thanks,

Chad

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Jul 2009, 08:30 AM

Hi Daniel Tharp,

I am also getting the same issue when I tried your code in my end. I guess the issue is because of you have set same name for RadWidnow and the function that opens the window. Can you try different names for RadWindow and calling function and see whether it is working fine?

ASPX:

 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    <Windows> 
        <telerik:RadWindow ID="AddPersonnel" runat="server" Title="Create New Personnel" 
            Height="375px" Width="625px" ReloadOnShow="true" Modal="true" OnClientClose="refresh" 
            Behavior="Close, Reload" /> 
    </Windows> 
</telerik:RadWindowManager> 

JavaScript:

 
<script type="text/javascript">     
function test()  
{  
    window.radopen("AddPersonnel.aspx""AddPersonnel");           
    return false;      
}       
function refresh()  
{      
    alert("Closed");   
}  
</script> 

Thanks,
Princy.

0
Georgi Tunev
Telerik team
answered on 01 Jul 2009, 01:17 PM
Hello Daniel,

This could happen if for some reason you are updating the RadWindowManager with Ajax. RadWindowManager's methods (radopen, radalert, radconfirm, GetRadWindowManager, etc) are always looking for the original RadWindowManager that is first rendered on the page. If this is your case I suggest using $find() to get a reference to the corresponding RadWindow and then to use the client-side show() method to open it.

If this doesn't help, please open a support ticket and send us a sample project that reproduces the problem so we could investigate.

All the best,
Georgi Tunev
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.
0
Daniel Tharp
Top achievements
Rank 1
answered on 01 Jul 2009, 04:45 PM
I finally figured out the problem I was having. The radwindow ID cannot be the same name as the Javascript function. thanks Princy for pointing this out.

thanks,

chad
Tags
Window
Asked by
Daniel Tharp
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Georgi Tunev
Telerik team
Daniel Tharp
Top achievements
Rank 1
Share this question
or