Here's how I would approach it. I would set up an event so when the tree is collapse, I would use the getFocus to find what item it's on and save that to somewhere. When the tree is expanded, use the setFocus to put the focus back on that item.
-tino On Tue, Jan 19, 2010 at 12:29 AM, JD <[email protected]> wrote: > Hi, > > Thanks for your reply. Below is the snippet. > > Say, I click on "Trash" and then I go on to collapse the tree right > from the root (Mail). The focus (marked by blue color), which was on > "Trash" gets lost once the tree is expanded again. > > I hope I am able to explain my problem. > > thanks & regards > - JD > ================================================= > <?xml version="1.0"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > viewSourceURL="src/index.html"> > <mx:Script> > <![CDATA[ > import flash.events.*; > import mx.events.*; > import mx.controls.*; > > [Bindable] > private var txml:XML = <node label="Mail" data="100"> > <node label="Inbox" data="70"/> > <node label="Personal Folder" data="10"> > <node label="Business" data="2"/> > <node label="Demo" data="3"/> > <node label="Saved Mail" data="5" /> > </node> > <node label="Sent" data="15"/> > <node label="Trash" data="5"/> > </node>; > > private function handleChange(e:ListEvent):void{ > mySelection.text = e.currenttarget.selectedit...@label; > } > ]]> > </mx:Script> > > <mx:Tree id="XMLTree1" width="150" height="170" > labelField="@label" dataProvider="{txml}" > change="handleChange(event)"/> > <mx:Form> > <mx:FormItem label="Tree Selected Item:"> > <mx:Label id="mySelection"/> > </mx:FormItem> > </mx:Form> > </mx:Application> > > On Jan 19, 7:18 am, [email protected] wrote: > > Can you supply code? > > > > > > > > On Mon, Jan 18, 2010 at 7:16 AM, JD <[email protected]> wrote: > > > Hi, > > > > > My problem, > > > > > I have a tree control in my application. Based on tree node selection > > > i have assigned certain action to the tree CHANGE event. > > > > > My problem is, suppose i have a particular tree node selected, and > > > subsequently when i collapse and thereafter expand the tree, the > > > currently selected item is no longer highlighted in the tree. > > > > > This is misleading as user thinks that he has lost the earlier > > > selection even though he has not clicked on any tree node. > > > > > This there a way out? > > > > > Any help is welcome. > > > > > TIA. > > > > > - JD > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Flex India Community" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<flex_india%[email protected]> > <flex_india%2bunsubscr...@googlegrou ps.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/flex_india?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<flex_india%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > > > >--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

