Trying to determine when a Listbox is loaded in IFrame

2 posts, 0 answers
  1. Greg
    Greg avatar
    2 posts
    Member since:
    May 2012

    Posted 17 May 2012 Link to this post

    Hello,

    I have a Telerik listbox which that loads via an aspx page inside an iFrame on a web form. The form is loaded and displayed using a specific application framework system (Metastorm).

    The values for the Listbox are actually loaded in client side using javascript when the web form loads, from text stored in a hidden text field elsewhere on the form.

    The problem I have is that I need to determine from the web form when the Listbox is fully loaded inside the iFrame.
    I have a javascript function on the form that executes every 0.2 milliseconds via the javascript setTimeout function which I use to test whether the listbox is loaded yet. However I have problems determining what to test for - e.g. a specific property set when the listbox is loaded.  I'm also having problems attaching to the  Listbox in the iFrame - e.g. document.getElementById('ListBoxFrameID').contentWindow.$find("<%= RadListBox1.ClientID %>") doesn't appear to locate it.

    Can someone give me some insight into resolving my problem?  I also have the same issue for a RadEditor that loads in an iFrame.

    Many Thanks
    Greg
  2. Greg
    Greg avatar
    2 posts
    Member since:
    May 2012

    Posted 17 May 2012 Link to this post

    I think I've got what I need from the following code:

          setTimeout("WaitforListboxLoad()",200);

    and

    function WaitforListboxLoad()
    {
        var myIframe = document.getElementById('ListboxFrameID');
        var oListbox = myIframe.contentWindow.$find("RadListBox1");
     
        if (oListbox == null)
        {
            setTimeout("WaitforListboxLoad()",200);
        }
     
    }

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