Opening a javascript popup from a page loading in a radwindow

14 posts, 0 answers
  1. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 17 Jul 2008 Link to this post

    I don't recall this having been an issue in the past, but I am now having this problem which I need help with.

    I use RadWindows to display Reporting Services reports. Occassionally some reports will contain links to external web pages which used to open in a new window via this method: javascript:void(window.open('http://myexternalpageurl', '_blank'))

    When I click on these links, nothing happens. I could have sworn this wasn't an issue in the past. I could revert back to the April or May builds to confirm, but would rather not have to.

    I need this functionality to work. Any ideas or alternate solutions?

    Thanks!!

    Paul
  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 17 Jul 2008 Link to this post

    Hello Paul,

    I was able to successfully launch a new window using the javascript method you described inside a RadWindow control. Here is the code I used to get it working:

    1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> 
    2  
    3 <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    4  
    5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    6  
    7 <html xmlns="http://www.w3.org/1999/xhtml"
    8 <head runat="server"
    9     <title>Untitled Page</title> 
    10 </head> 
    11 <body> 
    12     <form id="form1" runat="server"
    13         <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
    14      
    15         <telerik:RadWindow ID="RadWindow1" runat="server" 
    16             VisibleOnPageLoad="true" 
    17             Modal="true" 
    18             NavigateUrl="Window.aspx"
    19         </telerik:RadWindow> 
    20     </form> 
    21 </body> 
    22 </html> 
    23  

    1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Window.aspx.cs" Inherits="Window" %> 
    2  
    3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    4  
    5 <html xmlns="http://www.w3.org/1999/xhtml"
    6 <head runat="server"
    7     <title>Untitled Page</title> 
    8 </head> 
    9 <body> 
    10     <form id="form1" runat="server">         
    11         <href="#" onclick="javascript:void(window.open('http://www.google.com'))">Google</a> 
    12     </form> 
    13 </body> 
    14 </html> 
    15  

    Alternatively, you could use the following line, which does the same thing.

    <href="http://www.google.com" target="_blank">Google</a> 

    I hope this helped solve your problem. If you continue to have issues, please let me know.

    Sincerely,
    Kevin Babcock
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 17 Jul 2008 Link to this post

    I've seen it work on the sample page, so I know it should work. Since the link it generated automatically from within reporting services, I don't have too much control of the page itself. Here is the HTML for one of the links (with the url edited):

    <a tabindex="11" href="javascript:void(window.open('https://mydomain.com/')" style="color:White" TARGET="_top">203363</a>

    I'm not sure if the TARGET setting has anything to do with it. My guess is it may. All other examples show this as _blank which is fine but I don't see any way of changing the target setting that is automatically generated for the link in a reporting services page.
  5. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 17 Jul 2008 Link to this post

    As a side note:

    I saved the source of my reporting services web page and stored it locally on my web site and had the radwindow open that page instead. Sure enough, if I clicked on any of the links there they worked fine.

    So the question is, why would they work from there, but not when viewd from the Reporting Services page. The HTML from both versions is the exact same. Very strange!
  6. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 18 Jul 2008 Link to this post

    Hi Paul,

    To be able to help, we will need to examine this issue more closely.  Can you please send us a live URL where we can observe this problem? If the page is private and login credentials are needed, you can send them in a support ticket. We will check the case and we will do our best to help.

    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 18 Jul 2008 Link to this post

    Hi Svetlina,

    Unfortunately the site is internal and there would be no way to get access to you. I might be able to get you video and possibly some code, but other than that you'd have to be sitting next to me... You're welcome to visit us in sunny (when it's not raining) Florida :P

    Here's what we've discovered so far: If the link uses javascript:void(window.open(url)) it won't click through (although the pointer icon and status indicates it is aware it is a link). If we have the links use a standard http link, it clicks through (just not into a new window as we would like). Now keep in mind the page loading in the radwindow is getting generated from our Reporting Services server. If manually we create an aspx page with the same html output generated by reporting services, that page allows the clicks to happen.

    Here's another oddity. If we run it locally from Visual Studio, click throughs don't happen on any reports we load in the radwindow. If we publish to our production box, we get the same results. If we publish to the server that also houses Reporting Services then we get different results. Most of our reports don't click through, however, there is one report that has a drill through to a second page. The links in that second page do work. Why this report works here but not when run locally or on our production box we're not sure. All our IIS settings are identical. The only thing we can think of is the working copy is also the same machine that runs the reports. But that doesn't explain why all the other reports without the drill through still don't work.

    I really would prefer to continue using the RadWindow but it looks like we may end up having the report page load in a ugly browser popup window instead...

    If you have any miracles up you're sleeves I could certainly use them!
  8. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 18 Jul 2008 Link to this post

    I forgot to mention one thing. When I mentioned we did get one report working:
     
    That report has an aspx page we use that the end user picks parameters from using various controls and then the report loads into a radwindow from there. The links work on the drill through as I had explained. However, if we load the report directly into the radwindow bypassing the parameters the links are broken again. Same report, just loaded without preset parameters which we have to specify when the report comes up in the radwindow....

    This has to be the strangest hair pulling issue I've come across by far.
  9. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 18 Jul 2008 Link to this post

    I forgot to mention one thing. When I mentioned we did get one report working:
     
    That report has an aspx page we use that the end user picks parameters from using various controls and then the report loads into a radwindow from there. The links work on the drill through as I had explained. However, if we load the report directly into the radwindow bypassing the parameters the links are broken again. Same report, just loaded without preset parameters which we have to specify when the report comes up in the radwindow....

    This has to be the strangest hair pulling issue I've come across by far.
  10. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 21 Jul 2008 Link to this post

    Hi Paul,

    I would be very glad to assist you in solving the problem but I am afraid that I am not able to do this with the provided information.

    Once you are able to isolate the problem and send me a reproduction project or a live url along with detailed instructions I will test it and provide you with advice right away.


    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 21 Jul 2008 Link to this post

    Hi Svetlina,

    I would be more than happy to prepare a test for you, however the issue appears to be a combination of RadWindow and a page generated by Reporting Services. Unless you have a copy of Reporting Services, there's not much I can do other than create a video for you to see it in action. 
     
    If I have RadWindow open up any other web page I create, samples I've taken from the site, etc they always work. It seems to be specific to these two running together and with links using javascript:void(window.open('http://url')). All other click events do get fired (i.e. sorting columns, opening anchor tag links w/o javascript)

    Paul
  12. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Jul 2008 Link to this post

    Hi Paul,

    Yes, we can run the reporting services. Please send us the report (the RDL file) along with data (if possible) that reproduces the problem and we will check it right away.


    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Paul
    Paul avatar
    76 posts
    Member since:
    Feb 2008

    Posted 22 Jul 2008 Link to this post

    Not sure how to upload to you but  a test is very simple to set up and run.

    First create a Reporting Services project (through the wizard is fine). Doesn't matter what datasource and query you use to set this up as it's not really important for this test. You only need to do this because you can't proceed without setting something up. Once you have it created and it builds it's table based off your query, simply modify the header's properties to give it a navigation path (right-click - properties - navigation - jump to url) and set it to ="javascript:void(window.open('http://www.telerik.com', '_blank'))" I also renamed it to Click Me just to make it obvious. Make sure you can at least see the preview so no errors pop up.

    After that, deploy it to your reporting services server. That's all you should need to do on that end of things...

    For the ASPX page:

    Build a standard asp.net ajax website...

    Default.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <div> 
            <asp:Button ID="Button1" runat="server" Text="OpenReport" OnClick="OpenReport" /> 
        </div> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="True" 
            Height="768px" Width="1024px" Skin="Vista" Behaviors="Default" KeepInScreenBounds="True" 
            Modal="true" VisibleStatusbar="false" ShowContentDuringLoad="true" DestroyOnClose="true">  
        </telerik:RadWindowManager> 
        </form> 
    </body> 
    </html> 

    Default.aspx.cs
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
    using Telerik.Web.UI;  
     
    public partial class _Default : System.Web.UI.Page   
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
        }  
     
        protected void OpenReport(object sender, EventArgs e)  
        {  
            RadWindow newWindow = new RadWindow();  
            newWindow.NavigateUrl = "http://YourReportServicesServer/ReportServer?/TestRpt/TestRpt";  
            newWindow.ID = "DynamicallyCreatedWindow";  
            newWindow.Title = "Test";  
            RadWindowManager1.Windows.Add(newWindow);    
        }  

    That's all there is to it. When I launch it and it opens my test report, the click for the header doesn't work (Note: If I change the Jump To URL in the RDL to simply http://www.telerik.com, it will work but won't open in a new window)

    I hope I explained it well enough... If not let me know...
  14. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Jul 2008 Link to this post

    Hello Paul,

    I tried to reproduce the problem by following the steps that you described but everything is working as expected on my side. Can you please provide us (in a support ticket) with a live Url and login credentials to the report that you are having problems with?
    I would also like to ask you to do the following test - open your report not in a RadWindow but in a standard IFRAME - RadWindow is basically an IFRAME and it behaves just like one. If the problem still persist, then the reason for it is in how the browser handles reports displayed in an IFRAME.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  15. Arni
    Arni avatar
    17 posts
    Member since:
    Oct 2008

    Posted 13 Dec 2008 Link to this post

    hi.. i m having pblm in popup of radwindow..
    my requirement is.. i need the wdindow to get popup onw window.. if i cal any within first window.. Second one shoiuld be caled out of the first one..
    note: window shd not popup within any window..except the internet explorer.
    like this i need multiple caled out from onw window .. from there to other window..
    I saw the comunication between windows.. but.. code is just getting values from the second window..
    i need the code. to popup the second window out of the first window..
    kindly anyone help me..

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017