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

radAjax moves response in DOM which clears iframe document in Firefox

2 Answers 126 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Doug Domeny
Top achievements
Rank 1
Doug Domeny asked on 16 Oct 2008, 10:06 PM
Using the RadAjax control to load content that contains an iframe causes the iframe's document to be cleared because the content is moved within the DOM.

I've traced the problem down to Telerik.Web.UI.RadAjaxControl.InsertAtLocation, which calls insertBefore. The fact that insertBefore clears the iframe document is a problem with Firefox. My problem is figuring out why InsertAtLocation is called by the endRequest handler. It is looping through "panelsToClear[]". I would expect the response from the ajax request to be inserted at its target location without having to move it.

Unfortunately, I have not been able to create a simple application that shows the problem. It only happens in the more complex application.

Any insight on how to prevent InsertAtLocation from moving the content with the iframe is greatly appreciated. In fact, as I think of it, I might be able to initialize the iframe AFTER the radajax endRequest has finished moving it. Can I attach an event handler to that event from within the ajax response script?

Firefox 2.0.0.15

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 20 Oct 2008, 01:52 PM
Hello Doug Domeny,

I'm afraid that I'm not sure what exactly is the scenario you are trying to accomplish. Can you please give us little more details about the scenario and implementation, as some code snippets will be highly appreciated?

Unfortunately attaching to RadAjax responseEnd event programmatically at the end of the ajax request is not supported. However you can try attaching the eventHandler declaratively and to dynamically change the inner function which it calls. I have attached a simple page in order to demonstrate this approach.

Best wishes,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Doug Domeny
Top achievements
Rank 1
answered on 20 Oct 2008, 04:45 PM
Rosen,

Thank you for the quick reply and sample code. It's close to what I need, however, the problem is that I need to add my handler to the MS Ajax PageRequestManager endRequest array AFTER the radEditor adds its _endRequest handler to the array. I believe the sample you provided adds the myFunction handler BEFORE the onResponseEnd handler.

I was looking for a programmatic way to add to the OnResponseEnd event, but it appears to be a single event handler function and not an array.

What I have works, so I'm fine. Thanks again.
Tags
Ajax
Asked by
Doug Domeny
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Doug Domeny
Top achievements
Rank 1
Share this question
or