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

[Solved] Two windows on a page?

3 Answers 167 Views
Window
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 31 Aug 2009, 05:19 PM
Hi

I am having trouble with two windows on a page (maybe?).

I have a page with a grid, and two windows like this:

<telerik:radwindowmanager ID="RadWindowManager1" runat="server"   
        Title="MyWindows">  
        <Windows> 
        <telerik:RadWindow ID="RadWindow1" runat="server"   
                NavigateUrl="~/windows/request_list.aspx" OpenerElementID="divRequest"   
                CssClass="windowBody" Animation="None" Left="" Top="" BackColor="#5F6060"   
                Width="450px" Height="300px" 
                DestroyOnClose="False" ReloadOnShow="True" ShowContentDuringLoad="True"   
                Behaviors="Close,Move,Resize" Modal="True" VisibleStatusbar="False" VisibleOnPageLoad="False">  
        </telerik:RadWindow> 
          
        <telerik:RadWindow ID="RadWindowCurrency" runat="server"   
                ToolTip="Click to change currency setting"   
                NavigateUrl="~/windows/currency-swap.aspx" OpenerElementID="divChangeCurrency" 
                CssClass="windowBody" Animation="None" Left="" Top="" BackColor="#5F6060" 
                Width="350px" Height="360px"    
                DestroyOnClose="False" ReloadOnShow="True" ShowContentDuringLoad="True"   
                Behaviors="Close,Move,Resize" Modal="true" VisibleStatusbar="False">  
            </telerik:RadWindow> 
                       
        </Windows> 
        
    </telerik:radwindowmanager> 


The second window (RadWindowCurrency) works when the page has just been loaded
but will NOT open in the following circumstances:

1 ) after the first window has been opened and close again

2 ) after there has been a postback of the grid (which is in a separate radajaxpanel)

There is obviously some interaction, but what do you suggest a try to sort this out?

Thanks

Clive

3 Answers, 1 is accepted

Sort by
0
Clive Hoggar
Top achievements
Rank 1
answered on 31 Aug 2009, 06:32 PM
additional information:

Firefox shows 3 identical warnings: "Warning: Empty string passed to getElementById()."
in the error console
 
Clive
0
Clive Hoggar
Top achievements
Rank 1
answered on 31 Aug 2009, 07:03 PM
Hi
I went to mow the lawn, and this approach came to me... I am not sure if this the 'right' one.
I put this javascript as I have seen in other posts...

<script type="text/javascript" language="javascript">  
        function showWindow(win)   
        {  
            var oWnd = window.radopen(null, win);  
            oWnd.setUrl(oWnd.get_navigateUrl());  
        }  
 
        function OnClientClose(oWnd) {  
            documentdocument.location.href = document.location.href;  
        }  
    </script> 
and used 'OnClientClick' in each of the OpenerElementID, and passed the appropriate windowID
like this:

<
div id="divChangeCurrency">  
Display currency is currently   
<asp:Label ID="LabelCurrentCurrency" runat="server" Text=""></asp:Label>.   
<href="Javascript:onclientclick=showWindow('RadWindowCurrency');">Change currency</a>
</div> 

<

 

asp:Button ID="divRequest" runat="server" CausesValidation="False" Text="My Enquiry List"
UseSubmitBehavior="False" onclientclick="showWindow('RadWindow1');" />

 


One is a link and one a button for purely style reasons .

Does this seem OK ?

Thanks

Clive
0
Georgi Tunev
Telerik team
answered on 01 Sep 2009, 07:10 AM
Hi Clive,

Yes, this is the recommended approach. As it is noted in the documentation and the demos, the OpenerElementID functionality should be used in simple scenarios only because it uses the page's databinding mechanism. If the scenario is more complex and especially when Ajax is involved, you should use the client-side or server-side APIs of the control in order to show the window.

I hope this helps. If you still experience problems, please open a support ticket and send me your implementation so I could check it.



Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Clive Hoggar
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or