popup problem when launching multiple times

4 posts, 0 answers
  1. Daniel Tharp
    Daniel Tharp avatar
    13 posts
    Member since:
    May 2006

    Posted 30 Jun 2009 Link to this post

    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

     

     

     

     

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Jul 2009 Link to this post

    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.

  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 01 Jul 2009 Link to this post

    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.
  4. Daniel Tharp
    Daniel Tharp avatar
    13 posts
    Member since:
    May 2006

    Posted 01 Jul 2009 Link to this post

    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
Back to Top