Modal dialog will not open in IE7 or FF - fine in IE8 and Chrome

2 posts, 0 answers
  1. William Mace
    William Mace avatar
    12 posts
    Member since:
    Feb 2009

    Posted 01 Sep 2010 Link to this post

    We are encountering a strange browser issue.  We have a page that checks for the existence of a querystring on page load.  If it does not exist, the page_load event calls the following:

                    RadAjaxManager1.ResponseScripts.Add("OpenDialog();");

    This is the javascript called:
            function OpenDialog() {
                var url = "dialogs/NewDialog.aspx";
                var windowName = "NewDialog";
                var window = GetRadWindowManager().getWindowByName(windowName);

                modalWindow = GetRadWindowManager().open(url, window);
                modalWindow.set_width(400);
                modalWindow.set_height(200);
                modalWindow.set_modal(true);
                modalWindow.center();
                modalWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close);
                modalWindow.setActive(true);
            }

    This works fine in IE8 and Chrome.  It does not open the modal window in IE 7 or FF 3.6.8.

    BUT - as soon as I add a debug statement in the javascript like this:
            function OpenDialog() {
                alert("We are here");
                var url = "dialogs/NewDialog.aspx";
                var windowName = "NewDialog";
                var window = GetRadWindowManager().getWindowByName(windowName);

                modalWindow = GetRadWindowManager().open(url, window);
                modalWindow.set_width(400);
                modalWindow.set_height(200);
                modalWindow.set_modal(true);
                modalWindow.center();
                modalWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close);
                modalWindow.setActive(true);
            }
    It starts working fine in all browsers.

    Can anyone help me out as to where I am going wrong?  Thanks.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Sep 2010 Link to this post

    Hi William,

    It looks that the JS code is called before the controls are fully loaded on the page in such scenarios. I would suggest to either call the JavaScript code with a small timeout, or to use the Sys.Application.Load event and call the code there.


    Regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top