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

how to prevent a radwindow from opening twice from the same link

3 Answers 206 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 07 Aug 2014, 02:02 PM
I have a page that has links to pop up help documents in a radwindow.  The issue I want to resolve is if a user clicks a link more then one time I don't want multiple radwindows with the same help information.  Is there a way to prevent the same link from opening multiple times?

Here is the code i'm using to load the radwindow

  <script type="text/javascript">
    function GetRadWindow() {
      var oWindow = null; if (window.radWindow)
        oWindow = window.radWindow; else if (window.frameElement.radWindow)
          oWindow = window.frameElement.radWindow; return oWindow;
    }

    function radWin(myurl)
    {
      var oManager = GetRadWindow().get_windowManager();
      setTimeout(function () {
        oManager.open(myurl);
      }, 0);
    }
  </script>

Part of datagrid
<ItemTemplate>
    <%# DataBinder.Eval(Container.DataItem,"Path")%><a href="javascript:radWin('../temp.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"ID")%>')"><img src='../Images/Info.gif' border=0 alt="" /></a>
</ItemTemplate>

Thank you

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Aug 2014, 08:40 AM
Hi Jerry,

In order to open a page in RadWindow please try to use the radopen method and also include RadWindowManager in ASPX page.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>

JavaScript:
function radWin(myurl) {
    radopen(myurl);
}

Thanks,
Shinu.
0
Jerry
Top achievements
Rank 1
answered on 11 Aug 2014, 01:14 PM
Hi Shinu,

Thank you for your reply.  When I use radopen it opens the radwindow within another radwindow.  That is fine but I want to prevent the same link opening in two radwindows.  Say I have a link to www.yahoo.com and when I click on it a radwindow opens with yahoo.com.  Then I click the original link again I don't want a second window of yahoo.com to open I just one the first one to stay open.  Is there a way to check what url the open radwindows have?

Thank you,
Jerry
0
Shinu
Top achievements
Rank 2
answered on 12 Aug 2014, 04:11 AM
Hi Jerry,

Please try to set the Modal property of RadWindowManager to true to achieve your scenario. The Modal Popup feature of RadWindow creates a semi-transparend background behind the popup that hides the rest of the page so that the user cannot interact with the page until the modal dialog is closed.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="true">
</telerik:RadWindowManager>

Thanks,
Shinu.
Tags
Window
Asked by
Jerry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jerry
Top achievements
Rank 1
Share this question
or