Popup Window

11 posts, 0 answers
  1. JanTe
    JanTe avatar
    4 posts
    Member since:
    May 2007

    Posted 17 Apr 2008 Link to this post

    Hi,

    I have a form containing a toolbar which traps a client-side event to call a window.open to open up a popup window. On the popup window i have the same set up; where i want to open yet another popup window using the toolbar and client-side event to call window.open.

    what i am finding is that the second popup does not open up, although the code seems to get called.

    Please help.

    Jan
  2. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 17 Apr 2008 Link to this post

    Hello, please post your code so we can try to help.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. JanTe
    JanTe avatar
    4 posts
    Member since:
    May 2007

    Posted 17 Apr 2008 Link to this post

    Hi,

    how do i do post my code? do you have a facility to attach sample code or do i paste into the text? i have multiple pages that play together.

    Thanks,

    Jan

  5. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 17 Apr 2008 Link to this post

    The best way is to post the relevant snippets of your code by using the "FormatCodeBlock" tool which is built into the editor for composing these forum posts.  It is the second from the right on the top toolbar.
  6. JanTe
    JanTe avatar
    4 posts
    Member since:
    May 2007

    Posted 17 Apr 2008 Link to this post

    Hi,

    the toolbar defnition..

    1 <rad:RadToolbar ID="ToolBarRole" runat="server" UseFadeEffect="false" ImagesDir="~/images/">  
    2  <items> 
    3   <rad:RadToolbarButton ID="cmdNewRole" DisplayType="TextImage" ToolTip="Add a new Data  Source Table" CommandName="cmdNewRole" ButtonText="New Data Source Table" ButtonImage="new.gif" /> 
    4  </items> 
    5 </rad:RadToolbar> 

    Here is the code...

    <script type="text/javascript">  
                <!--  
                    //Get the ToolBar Handle and Set the Event.  
                    mIntID = "<%=ToolBarRole.ClientID%>";                                      
                    mObjToolBar =  document.getElementById(mIntID);  
                    <%= ToolBarRole.ClientID %>.attachEvent("OnClientClick","click_handler");  
                      
                    function click_handler(sender, e)  
                    {  
                        if (sender.CommandName == "cmdNewRole")  
                        {  
                            //Get the Screen Resolution and Determine How large to make the Window  
                            var mScreenHeight = screen.height * 0.6;  
                            var mScreenWidth = screen.width * 0.6;  
                            //Center the Form   
                            var mFormLeft = (screen.width - mScreenWidth)/2;  
                            var mFormTop = (screen.height - mScreenHeight)/2;  
                            //Show the Form.  
                            window.open("Details.aspx?Action=New","Role","left=" + mFormLeft + ",top=" + mFormTop +",height=" +  mScreenHeight + ",width=" + mScreenWidth +",scrollbars=no,menubar=no,toolbar=no,resizable=yes");  
                        }  
                    }  
                --> 
    </script> 

    I have this on the first page (default.aspx) and on the popup page (details.aspx). on the details.aspx teh alert shows but the window.open  fails. I am trying to show two different pages. In other words, default.aspx calls window.open to open details.aspx which calls window.open to open second.aspx (which fails).

    your help is much appreciated!

    Jan
  7. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 18 Apr 2008 Link to this post

    Hi JanTe,

    The window is actually opened, but it gets opened in the same container. This happens because of the window name parameter (the second parameter to the window.open method). You can overcome this by specifying a different name for the new window in the popup page.

    I hope this helps.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. JanTe
    JanTe avatar
    4 posts
    Member since:
    May 2007

    Posted 18 Apr 2008 Link to this post

    Hi,

    problem solved. Thanks very much...Great Response turn around

    Jan
  9. Liu Peng
    Liu Peng avatar
    18 posts
    Member since:
    Oct 2006

    Posted 03 Feb 2009 Link to this post

    Hi,

    I using RadToolBar do the same thing: using window.open to open a new window, my problem is that on FireFox(v3.0.5) the new popup  window will be not the active window, it will hide behind the parent window.
    please look at my codes:
    <telerik:RadToolBar ID="RadToolBar1" runat="server"
            <Items> 
                <telerik:RadToolBarButton Text="Button1" NavigateUrl="http://www.google.com/"></telerik:RadToolBarButton> 
                <telerik:RadToolBarButton Text="Button2" NavigateUrl="javascript:voidOpenCustomizedLists();"></telerik:RadToolBarButton> 
            </Items> 
            </telerik:RadToolBar>

    function voidOpenCustomizedLists() 
        window.open("http://www.google.com/","_blank","top=50px,left=50px,height=650px,width=900px,resizable=yes,status=yes",false); 

    this problem only appear on FireFox, IE is will.

    thanks,
    LP





  10. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Feb 2009 Link to this post

    Hello Liu,

    I suggest you focus the opened window like this:

    function voidOpenCustomizedLists()    
    {    
        var win = window.open("http://www.google.com/","test","top=50px,left=50px,height=650px,width=900px,resizable=yes,status=yes"true);    
        win.focus();  
    }  
     
     

    Best regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Liu Peng
    Liu Peng avatar
    18 posts
    Member since:
    Oct 2006

    Posted 04 Feb 2009 Link to this post

    Hello,

    Yes, It can solve my problem, thanks, I think the above will be more simple:
    function voidOpenCustomizedLists()     
    {     
        window.open("http://www.google.com/","test","top=50px,left=50px,height=650px,width=900px,resizable=yes,status=yes"true).focus()

    Could you tell me the reason about we must call the focus() clearly? And this problem only occur with RadToolBar on FireFox, Is it a bug
    for RadToolBar?

    regards,
    LP
  12. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 05 Feb 2009 Link to this post

    Hi Liu,

    We'll investigate the reason for this issue in RadToolBar.

    Kind regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017