[CLOSED] Dynamically Build TreePanel with PageTreeLoader

  1. #1

    [CLOSED] Dynamically Build TreePanel with PageTreeLoader

    I'm trying to dynamically add a treepanel with loader and all works fine until I click to expand the root node then I get the error message "The control with ID 'SP_2' not found" Which is the ID of the TreePanel. Any thoughts?

    Code Behind called from Page_Load event:
       Private Sub BuildPrivateSiteMenu()
            Dim tree As New TreePanel()
            tree.ID = "SP_2"
            tree.Title = "Online Users"
            tree.RootVisible = True
            Dim root As New Ext.Net.AsyncTreeNode()
            root.NodeID = "AAA_ROOT"
            root.Text = "SP"
            root.Expanded = False
            tree.Root.Add(root)
            Dim loader As New PageTreeLoader()
            AddHandler loader.NodeLoad, AddressOf GetPrivateNodes
            loader.PreloadChildren = True
            tree.Loader.Add(loader)
    
            WestPanel.Items.Add(tree)
        End Sub
    GetPrivateNodes function never gets called:
    
     Protected Sub GetPrivateNodes(ByVal sender As Object, ByVal e As NodeLoadEventArgs)
        End Sub
    Partial ASPX Page:
     <ext:Panel ID="WestPanel" runat="server" Region="West" Split="true" Collapsible="true"
                        Title="Enterprise Navigator" Width="225" BodyStyle="background-color: transparent;"
                        Border="true" Layout="AccordionLayout">
                        <Items>
                            <ext:TreePanel ID="tpPublic" runat="server" Width="300" Icon="BookOpen" RootVisible="false"
                                AutoScroll="true" UseArrows="true" Border="false" ViewStateMode="Enabled" ContainerScroll="true">
                                <Root>
                                    <ext:AsyncTreeNode NodeID="AAA_ROOT" Text="Station Public" Expanded="true" />
                                </Root>
                                <Loader>
                                    <ext:PageTreeLoader OnNodeLoad="GetPublicNodes" PreloadChildren="true">
                                        <BaseParams>
                                            <ext:Parameter Name="Site" Value="1" Mode="Value" />
                                        </BaseParams>
                                        <EventMask ShowMask="true" Target="Parent" Msg="Loading..." />
                                    </ext:PageTreeLoader>
                                </Loader>
                            </ext:TreePanel>
                        </Items>
                        <Plugins>
                            <ext:KeepActive ID="KeepActive1" runat="server" />
                        </Plugins>
                    </ext:Panel>
    Last edited by Daniil; Jan 29, 2013 at 3:47 AM. Reason: [CLOSED]
  2. #2
    Hi @HOWARDJ,

    The PageTreeLoader OnNodeLoad event is a DirectEvent.

    A control's DirectEvent requires a control instance on a server.

    I'm trying to dynamically add a treepanel with loader
    I assume you render a TreePanel during an AJAX request (DirectEvent or DirectMethod). Is that correct?

    If so, then, I guess you don't recreate the TreePanel control during other AJAX requests.

    You can recreate the TreePanel control.

    But I would prefer to load nodes one of these ways.
    https://examples1.ext.net/#/TreePane...Method_Loader/
    https://examples1.ext.net/#/TreePane...Using_Handler/
    https://examples1.ext.net/#/TreePane...iceTreeLoader/

Similar Threads

  1. [CLOSED] Can not build Trunk with .NET35 build configuration
    By jchau in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 24, 2012, 2:20 PM
  2. Replies: 0
    Last Post: Apr 18, 2012, 6:48 PM
  3. [1.0] TreePanel - PageTreeLoader issue
    By pbsoft in forum 1.x Help
    Replies: 1
    Last Post: Aug 04, 2010, 6:26 PM
  4. Dynamically changing Treepanel other Treepanel
    By airforcz in forum 1.x Help
    Replies: 0
    Last Post: Jun 16, 2010, 8:33 AM
  5. Dynamically build Form Panel
    By glenh in forum 1.x Help
    Replies: 5
    Last Post: Aug 10, 2009, 4:07 AM

Tags for this Thread

Posting Permissions