I think we just fixed the first issue internally, I'll forward on the
issue about it remaining highlighted.

Matt

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pasflex
Sent: Friday, March 31, 2006 8:32 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problems with tree selectedNode - Flex 2

I'm seeing some odd behavior when using the selectedNode property of 
the tree to return to a node in a tree or it's quite possible that 
I'm not using it correctly.

The first issue is that if there are identical nodes in different 
branchs of the tree visible setting selectedNode will just go the 
first node.  Run the example code below, but first open the 'dir1' 
branch before clicking the button to see this behavior, it works as 
expected if the 'dir1' branch is closed.

The second thing is that when selectedNode is set and another 
element of the tree is selected the selectedNode remains highlighted 
until you mouse over it.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
creationComplete="initTree()">
 <mx:XML id="xml">
  <node label="root">
   <node label="dir1">
    <node label="file1"/>
   </node>
   <node label="dir2">
    <node label="file1"/>
   </node>
  </node>               
 </mx:XML>
 <mx:Tree id="t1" labelField="@label" showRoot="false" width="200" />
 <mx:Button label="Select Node" click="selectNode()"/>
 <mx:Script>
  <![CDATA[
   import mx.collections.XMLListCollection;
   import mx.collections.XMLList;
   private function initTree():void
   {
    t1.dataProvider = new XMLListCollection(new XMLList(xml));
   }
                        
   private function selectNode():void
   {
    t1.setIsOpen(t1.getNodeDisplayedAt(0), true);
    t1.setIsOpen(t1.getNodeDisplayedAt(0).children()[1], true);
    t1.selectedNode = t1.dataProvider.children()[0].children()
[1].children()[0];
   }
  ]]>
 </mx:Script>
</mx:Application>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to