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

Changing window clientidmode to static causes JavaScript error

3 Answers 253 Views
Window
This is a migrated thread and some comments may be shown as answers.
mc2000
Top achievements
Rank 1
mc2000 asked on 18 Feb 2011, 08:45 PM
Here is my RadWindow declaration:

<telerik:RadWindow ID="VideoPlayerWindow" ClientIDMode="Static" runat="server" Modal="True" VisibleOnPageLoad="false" EnableShadow="true"
    Behaviors="Close" ReloadOnShow="true" AutoSize="true" OnClientBeforeClose="StopVideo">
    <ContentTemplate>
        <asp:UpdatePanel ID="VideoPlayerUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
        <uc1:ucVideo ID="Video1" runat="server" />
        </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</telerik:RadWindow>

My previous JavaScript code to open the window was a little redundant if not messy (BEFORE SETTING CLIENTIDMODE = STATIC)

...
if (clientId == "VideoPlayerWindow") { oWnd = $find("<%=VideoPlayerWindow.ClientID%>"); }
...

I wanted to set the clientidmode to static and change the code to

oWnd = $find(clientId);

which returns a RadWindow object. When the window goes to open, however I get a JavaScript error and the window is blank:

Microsoft JScript runtime error: 'this._contentElement.style' is null or not an object
The line in ScriptResource:

}

 

if(this._dockMode){this._contentElement.style.width="1px";

I am using the 2010.3.x version of the RadControls for ASP.NET. Thanks!

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Feb 2011, 03:40 PM
Hi mc2000,

Yes, we are familiar with this issue (there are several threads about this in the forums), however this behavior is expected. Microsoft recommends using ClientIDMode=Static only for static control. RadControls on the other hand are controls with complex hierarchies of child controls and templates so setting their ClientID mode to static will break their functionality.



Kind regards,
Georgi Tunev
the Telerik team
0
Ziga HABJAN
Top achievements
Rank 1
answered on 04 Mar 2015, 06:13 AM
Will this be fixed? (I see no good reason why you couldn't make it work with a static clientid - it's just the "root" element id - and it does work in radgrid, which is probably more complex than window itself (hierarchy, templates, etc, ...))..
0
Marin Bratanov
Telerik team
answered on 04 Mar 2015, 01:22 PM

Hello Ziga,

There are plans to improve integration with ClientIDMode=Static, but I cannot offer an ETA at the moment. For the time being I advise against using it for any of our controls, as unpredictable issues may arise, even if things seem to work fine initially.

Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
mc2000
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Ziga HABJAN
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or