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

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

1 Answer 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
William Mace
Top achievements
Rank 1
William Mace asked on 01 Sep 2010, 08:30 PM
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.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Sep 2010, 01:32 PM
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
Tags
Window
Asked by
William Mace
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or