Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > Modal window cannot be loaded twice in a row

Not answered Modal window cannot be loaded twice in a row

Feed from this thread
  • Jose avatar

    Posted on Jun 24, 2011 (permalink)

    I have the following code to create a modal window:

    function openCalculator() {
        var acts = new Array();
        acts[0] = "Refresh";
        acts[1] = "Close";
     
         
        var windowCalculator = $.telerik.window.create({
            title: "Rate Calculator",
            html: '',
            contentUrl: "/RulesEngine/RateCalculator/",
            modal: true,
            resizable: true,
            height: 350,
            width: 800,
            draggable: true,
            actions: acts,
            visible: false,
            onClose: function (e) {
     
                 e.preventDefault();
                windowCalculator.destroy();
            }
        })
        .data('tWindow').center().open();
     
    }

    If the user closes the modal window and tries to re open it, the program throws the following exception:

    Unable to get value of the property 'window': object is null or undefined

    In addition. The function only loads its content from the contentURL page the first time. it does not refresh the content every time the function is called, which is the behavior that we would expect. Can you help me, please?

    Reply

  • Alex Gyoshev Alex Gyoshev avatar

    Posted on Jun 29, 2011 (permalink)

    Hello Jose,

    We could not reproduce this problem neither in Firefox 5, nor in IE9. Please try upgrading to the attached build and see whether the problem persists.

    Best wishes,
    Alex Gyoshev
    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

    Reply

  • Jose avatar

    Posted on Jun 29, 2011 (permalink)

    Thank you Alex, but I found the problem yesterday. The problem wasn't in my javascript function; it was in the url where I get the content for the window. I was including the jquery scripts in that page; once I took the links out, it worked perfectly.

    Reply

  • Ankit avatar

    Posted on Dec 21, 2011 (permalink)

    Hi Jose,

    This is kinda late but still... I had the same problem. I was loading the content of my window dynamically and when I included scripts, I was not able to open it the second time. But I cannot get rid of the scripts as I am using jQuery validation. And since the content which is loaded is from PartialView, I have to include the scripts there. Any suggestions or workarounds?

    Thanks
    Ankit

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > Modal window cannot be loaded twice in a row
Related resources for "Modal window cannot be loaded twice in a row"

ASP.NET MVC Window Features  |  Documentation  |  Demos  |  Telerik TV ]