needs two clicks to open radwindow

2 posts, 0 answers
  1. William
    William avatar
    56 posts
    Member since:
    Sep 2008

    Posted 16 Mar 2012 Link to this post

    I need a little help.  I am having a problem opening a radwindow from a parent radwindow.  I have a radwindow that is called from a radgrid.
    <CommandItemTemplate>
                                   <table width="100%">
                               <tr class="customFont">
                             
                              <td align="left">
                               <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="openWin('/portals/0/NewSearch.aspx?AuthoringNames='); return false;"  >
                                  <img style="border:0px;vertical-align:middle;" alt="" src="/portals/0/Images/add-icon.png" />New Search</asp:LinkButton>                              
                                     
                                        <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="openWin2('/portals/0/NewPublicationList.aspx'); return false;"  >
                                  <img style="border:0px;vertical-align:middle;" alt="" src="/portals/0/Images/add-icon.png" />Import PMID List</asp:LinkButton>                              
                                                              
                                  
                                  <td align="left">
                                 </td>
                                                      
                              <td align="right">
                                  <asp:LinkButton ID="LinkButton4" runat="server" OnClientClick="refreshGrid(); return false;" >
                                  <img style="border:0px;vertical-align:middle;" alt="" src="/portals/0/Images/Refresh.png" /> Refresh</asp:LinkButton>
                                      
                              </td>
                          </tr>
             
               </table>
                  </CommandItemTemplate>

    The linkbutton calls


    function openWin2(url) {
            var oWnd = $find("<%=RadWindow1.ClientID%>");
              var authorNames = document.getElementById('<%=HiddenField1.ClientID%>').value;
              oWnd.setUrl(url + "?AuthoringNames=" + authorNames);
           var oWnd = radopen("/portals/0/NewSearch.aspx?AuthoringNames=" + authorNames, "RadWindow1");
            }
    The linkbuton needs two click to call the function.  If I change the function to oWnd.Show that it works on one click but I then can't get the parentwindow from the opened radwindow to open another window.  This line totally freezes in the opened window and will not call the second window
    var oWnd2 = parentRadWindowManager.open("/portals/0/QuerySaver.aspx", "RadWindow3");

    and this is my originating forms radWindow code

    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" Modal="True"
         runat="server" EnableShadow="true">
         <Windows>
             <telerik:RadWindow ID="RadWindow1" runat="server"  Modal="true" Width="750" Height="600" OnClientClose="OnClientClose" Behaviors="Close,Move"
               ReloadOnShow="true" NavigateUrl="/portals/0/NewSearch.aspx" >
             </telerik:RadWindow>
                <telerik:RadWindow ID="RadWindow2" runat="server"  Modal="true" Width="750" Height="300" OnClientClose="OnClientClose" Behaviors="Close,Move"
               ReloadOnShow="true"  >
             </telerik:RadWindow>
             <telerik:RadWindow ID="RadWindow3"  runat="server" Width="650" Height="480" Modal="true"  NavigateUrl="/portals/0/QuerySaver.aspx" >
             </telerik:RadWindow>
             </Windows>
     </telerik:RadWindowManager>



    Is this because I have my link button on a radGrid?
    I've tried to totally follow your demos but none have it starting from a radgrid.

    Thanks

    Bill

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5363 posts

    Posted 20 Mar 2012 Link to this post

    Hi,

    Please start by examining this help article on the different ways to open a RadWindow. Directly calling radopen() is sufficient, otherwise you should call its show() method and remove the radopen() line.

    I also advise that you examine this help article on opening a RadWindow from another RadWindow. Please note the timeout.

    I am attaching here a simple page that works correctly (see here), opens the first RadWindow from a link button in a grid (which is not relevant, actually) and the second is opened via code from within the first but its parent is the main page. Please examine it and try to incorporate this functionality in your project.


    All the best,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top