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

[Solved] ReOpening Rad Window

1 Answer 119 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mick
Top achievements
Rank 1
Mick asked on 08 Apr 2008, 10:58 AM
Hi I have a situation where I call a RadWindow to open using javascript within a user control.
This works fine the first time I call the window to open, however, if I call it again, then I get a javascript error. My code is as follows:
<script type="text/javascript" language="javascript">  
            function openRadWindow()  
            {  
                // Get the Details of the postcode textbox  
                var txt = document.getElementById("<%=txtAppPostcode.ClientID %>").value;  
                if(txt == ''){  
                    alert('A partial address must be entered');  
                    return;  
                }  
                // Open Our Rad Window  
                var oWnd = radopen("pointer.aspx?SearchText=" + txt, "rwPointer" );  
   
                oWnd.Skin = "Vista";  
                oWnd.Center();  
                document.getElementById("<%=txtAppPostcode.ClientID %>").value = '';  
            }  
        </script>  
I read somewhere that it has something to do with the ID of the window being opened, so I tried to set the window ID from javascript using the following code:
<script type="text/javascript" language="javascript">  
            function openRadWindow()  
            {  
                 var dt = new Date();   
                // Get the Details of the postcode textbox  
                var txt = document.getElementById("<%=txtAppPostcode.ClientID %>").value;  
                if(txt == ''){  
                    alert('A partial address must be entered');  
                    return;  
                }  
                // Open Our Rad Window  
                var oWnd = radopen("pointer.aspx?SearchText=" + txt, "rwPointer" );  
                oWnd.ID = dt.getMilliseconds();   
                oWnd.Skin = "Vista";  
                oWnd.Center();  
                document.getElementById("<%=txtAppPostcode.ClientID %>").value = '';  
            }  
        </script>  
But this didn't work either. I need the user control to be reusable, so if anyone can tell me where I am going wrong, I would be grateful.
Kind Regards

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 09 Apr 2008, 02:46 PM
Hi Mick,

Can you please provide more details about your setup?
  1. What is your RadWindowManager / RadWindow declaration?
  2. How do you call the openRadWindow() function?
  3. What is the exact error that you receive?


Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Mick
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or