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

Dialogs not working because they now rely on a global "theForm" JavaScript object

4 Answers 99 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 11 Jun 2008, 08:19 PM

We just updated our project with the latest release and now tool buttons that need to open a dialog fail in the _addWindowToDocument function (on line 6 of the following fragment)

_addWindowToDocument:function(){     
  var _ac=document.getElementById(this._formID);     
  if(!_ac){     
    _ac=document.forms[0];     
  }     
  _ac.insertBefore(this._popupElement,theForm.firstChild);     
}    

...am I missing something?  It would be ideal if this global var wasn't expected to always be defined.  What would you recommend for a "fix"? 

I can throw in some temp code so "theForm" is always defined for us, but that just feels wrong :) 

4 Answers, 1 is accepted

Sort by
0
Dimitris
Top achievements
Rank 1
answered on 13 Jun 2008, 12:37 AM
Hello

I have exactly the same for problem and have no idea how to set this variable or what to do to resolve it

Thanks in advance
0
Tervel
Telerik team
answered on 13 Jun 2008, 06:31 AM
Hello,

We were able to verify the problem and are taking action to fix it right away. The corrected version will appear in Q1 SP2 coming next week. In case you need a working solution immediately, a temporary workaround would be to override the method - that is, to add the following javacript code somewhere in the body of your pages (not to the head).
<script>

Telerik.Web.UI.RadWindow.prototype.

_addWindowToDocument =

function()
{
    var form = document.getElementById(this._formID); 
    if (!form) form = document.forms[0]; 
    form.insertBefore(
this._popupElement, form.firstChild);
};


</script>

We are very sorry for the issue, as it is an ommition on our end.

All the best,
Tervel
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Dimitris
Top achievements
Rank 1
answered on 15 Jun 2008, 12:13 PM

Hello ,

I was able to deal with this problem by changinginf my web.config from 

<

xhtmlConformance mode="Legacy"/>

to <

xhtmlConformance mode="Transitional"/>. Will this give me other errors in the future or can I stick with it? Do I still have to add the Javascript for the pop-up window or this is not nessecary now?

Thanks for your prompt reply

0
Tervel
Telerik team
answered on 16 Jun 2008, 10:20 AM
Hello Dimitris,

With the Q1 SP2  coming out later this week you will not need to use the provided javascript. The javascript was meant as a temporary workaround to help before the SP2 is released.


Sincerely yours,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Nathan
Top achievements
Rank 1
Answers by
Dimitris
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or