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

RadTreeView with Context Menus in RadPanelBar producing JavaScript errors

2 Answers 151 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Irene
Top achievements
Rank 2
Irene asked on 30 Jul 2008, 04:11 PM

Hello,

We have a problem with RadTreeView with Context Menus running in the PanelBar. Every time menu gets repainted (right mouse click, etc.) we are getting a JavaScript error. The same tree with the same menus running outside the PadPanelBar functions fine.  The Context Menus both populated in runtime and static – the same behavior.

 

Details:

 

Version: .NET 3.5 ; Telerik  ASP.NET controls  for  3.5 (2008.1.619.35)

The error is in the code (js):

Telerik.Web.UI.RadMenu._getMaxRootItemWidth=function(_43){

var _44=Telerik.Web.UI.RadMenu._getChildListElement(_43);

var _45=_44.childNodes; ß-this line, 'childNodes' is null or not an object

_43- is a Context Menu element, at the time of the error it is empty, though after you ignore the errors (there can be a number of them ,all the same) the context menu displays just fine.

_44 is null

Some call stack details (not every call stack element, just those seem important)

Called from: var _3e=Telerik.Web.UI.RadMenu._getMaxRootItemWidth(_3d);

Called from: if(this._flow==Telerik.Web.UI.ItemFlow.Vertical){

Telerik.Web.UI.RadMenu._adjustRootItemWidth(this.get_id());

} –tried to set Flow=”Horizontal” in the menu or in the DefaultSettingsGroup- didn’t help

Called from: _7.repaint();

Called from: $telerik.repaintChildren(this); where “this” is a PanelBar – this.element.id=     ctl00_ContentPlaceHolder1_rpbNav

Called from: this.get_panelBar()._callRadShow();

Called from:

if (!initialLoad) {

            // If this isn't the first page load (i.e. we are doing an async postback), we

            // need to re-raise the Application's load event.

            Sys.Application.raiseLoad();

        }, which is in  MicrosoftAjaxWebForms.js

 

Looks like the conext menu gets interrogated by repaint from RadPanleBar before it gets populated.

 

Part of .ASPX page (it is a content page within master page):

 

<telerik:RadPanelItem runat="server"  Text="Farm Hierarchy"

                                Width="100%" Value="FarmHierarchy" Expanded="true" >

                                <Items>

                                 <telerik:RadPanelItem runat="server" Value="FarmHierarchyBody" >

                            <ItemTemplate>

                           <asp:UpdatePanel ID="upMenu" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">

                                            <ContentTemplate>

                                                <cc2:xcPanel ID="pnlFarmTree" runat="server" Width="100%" CssClass="PanelNoBorder" meta:resourcekey="pnlFarmTreeResource1">

                                                    <cc2:xcTreeView ID="trMenu"  runat="server" CssClass="TreeView" PersistLoadOnDemandNodes="true" Height="400px"

                                                        NodeIndent="15"

                                                        onnodeexpand="trMenu_TreeNodePopulate" ShowLines="True" Style="border-top-style: none;

                                                        border-right-style: none; border-left-style: none; border-bottom-style: none"  Skin="Sunset"  MultipleSelect="true"

                                                        Width="100%" meta:resourcekey="trMenuResource1" onnodeclick="tree_NodeClick"  SingleExpandPath="false" OnContextMenuItemClick="tree_ContextClicked" onClientContextMenuShown="ClientContextMenuShown"

                                                       >

                                                        <ContextMenus>

                                                        <telerik:RadTreeViewContextMenu Skin="Outlook" ID="EmptyMenu" runat="server" Width="30px" >

                                                                 <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                <telerik:RadMenuItem   IsSeparator="true"></telerik:RadMenuItem>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                            <telerik:RadTreeViewContextMenu Skin="Outlook"  Font-Size="8pt" ID="FARMCMenu"  runat="server">

                                                                 <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                             <telerik:RadTreeViewContextMenu Skin="Outlook"  Font-Size="8pt" ID="WAPCMenu" runat="server">

                                                                 <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                             <telerik:RadTreeViewContextMenu Skin="Outlook"  Font-Size="8pt" ID="SITECMenu" runat="server" flow="Horizontal">

                                                                 <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                             <telerik:RadTreeViewContextMenu Skin="Outlook"  Font-Size="8pt" ID="WEBCMenu"   runat="server">

                                                                 <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                             <telerik:RadTreeViewContextMenu Skin="Outlook"  Font-Size="8pt" ID="GROUPCMenu" runat="server">

                                                                <defaultgroupsettings flow="Horizontal" />

                                                                <Items>

                                                                </Items>

                                                            </telerik:RadTreeViewContextMenu>

                                                        </ContextMenus>

                                                       

                                                    </cc2:xcTreeView>

                                                </cc2:xcPanel>

                                                </ContentTemplate>

                                        </asp:UpdatePanel>

                            </ItemTemplate>

                            </telerik:RadPanelItem>

                        </Items>

                        </telerik:RadPanelItem>

 

For this particular page menus are populated dynamically, although we have the same problem in another tree with a static context menu.

 

Please help. Our release is closing and we really like the functionality of the PanelBar and would like to include it into the released version.

 

Thanks a lot,

 

Irene Troupansky

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 31 Jul 2008, 12:16 PM
Hello Irene,

Thank you for contacting us.

We tested the described scenario with the latest version of RadControls and weren't able to reproduce the problem. Please find attached a sample project demonstrating RadTreeView with context menu in RadPanel which works as expected. 

Could you, please, upgrade to the latest official version of RadControls for ASP.NET AJAX (2008.2.723)?
If you still experience this problem, please open a support ticket and send us your project, so we can test it locally. Thanks

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Irene
Top achievements
Rank 2
answered on 04 Aug 2008, 09:54 PM
Thank you very much for the quick reply!

Getting the new version of Telerik cleared the problem.

Irene
Tags
PanelBar
Asked by
Irene
Top achievements
Rank 2
Answers by
Yana
Telerik team
Irene
Top achievements
Rank 2
Share this question
or