Home - Forums-.NET - FlyTreeView (ASP.NET) - Problem with onSelectedNodeChanged after postBack

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Problem with onSelectedNodeChanged after postBack
Link Posted: 02-Aug-2007 01:22
hi...
my flyTreeView_onSelectedNodeChanged is working fine when my page is not post back, but after post back it is not fired,then if i click twice on any node it come to work fine again.
my node is look like:

+Computers
       mouses
       KeyBoards

when page load and when i press on computer node it work fine then it expand to 2 childs nodes that is mouses and keyboards, when i press mouses it do post back and get some data and display it. (here is the problem) when the post back is done and when i press any node in the tree it dosnt fire the flyTreeView_onSelectedNodeChanged again , but when press on it again it return to work !!

this is my js code


        
        var treeview;
        var currentNodeID;
        
        function flyTreeView_onInitialized(treeviewObject)
        {
            treeview = treeviewObject;
            
            if(treeview.getSelectedNode() != null)
            {
                currentNodeID = treeview.getSelectedNode().getValue();
            }
        }

        function flyTreeView_onSelectedNodeChanged(sender,oldNode,node)
        {
            currentNodeID = node ? node.getValue() : \"null\";            
        }  



                     BorderColor=\"silver\" BorderWidth=\"1px\" Padding=\"3px\" FadeEffect=\"true\" WideCell=\"true\"
                     CanBeSelected=\"false\" ContentClickCollapses=\"true\" OnInitializedJavascript=\"flyTreeView_onInitialized\"
                     OnSelectedNodeChangedJavascript=\"flyTreeView_onSelectedNodeChanged\">
                        
                        
                        
                            
                        
                        
                            
                        
                    
Link Posted: 02-Aug-2007 04:12
First thing I noticed is


This will not work in Firefox, so probably it would be better to change to



Also, you're using CanBeSelected=False , this prevents nodes from being selected.

Also, you do not have SelectedStyle. How do you distinguish Selected nodes?
I created a small test case with your code, added some nodes having CanBeSelected set to True, and it seems to work ok (I'm using 4.3 version).



What is the version of control you're using (4.2 or 4.3)?