Two windows on a page?

4 posts, 0 answers
  1. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 31 Aug 2009 Link to this post

    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

  2. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 31 Aug 2009 Link to this post

    additional information:

    Firefox shows 3 identical warnings: "Warning: Empty string passed to getElementById()."
    in the error console
     
    Clive
  3. Clive Hoggar
    Clive Hoggar avatar
    348 posts
    Member since:
    Nov 2008

    Posted 31 Aug 2009 Link to this post

    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
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 01 Sep 2009 Link to this post

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