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

Trying to determine when a Listbox is loaded in IFrame

1 Answer 40 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 17 May 2012, 11:11 AM
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

1 Answer, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
answered on 17 May 2012, 02:11 PM
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);
    }
 
}

Tags
ListBox
Asked by
Greg
Top achievements
Rank 1
Answers by
Greg
Top achievements
Rank 1
Share this question
or