Try TreeForm.updateList();

Raf


--- In flexcoders@yahoogroups.com, "Tom Preet" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> In my application am using Tree with nodes  when I click on the node
it was
> displaying the alert,
> but when I selected the first node the related page was displaying, next
> time when I click
> on another node it was not displaying the second page.
> 
> Now I need to use it as when I click on particular node the related
page was
> displayed.
> 
> how to refresh the nodes when selecting the each node simultaniously.
> 
> *My Application:*<?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="1094"
> height="640" verticalScrollPolicy="off" horizontalScrollPolicy="off">
>  <mx:Script>
>   <![CDATA[
>   import mx.controls.Alert;
> 
>   private function changeEvt(event:Event):void {
> 
>    var selectedNode:String = ""
>    if ([EMAIL PROTECTED] )
>    {
> 
>    selectedNode = [EMAIL PROTECTED];
>    //Alert.show("the data "+selectedNode);
> 
>      if(selectedNode=="abc Node")
>      {
> 
>       var abc:abcForm = new abcForm();
> 
>      rightPane.addChild(abc);
>      }
>     else if(selectedNode=="ddd Node")
>      {
>       Alert.show("Access");
>       var ddd:ddForm = new ddForm();
> 
>       rightPane.addChild(ddd);
>      }
>   else if(selectedNode=="zzz Node")
>      {
>       Alert.show("Error");
>       var zzz:zzForm = new zzForm();
> 
>      rightPane.addChild (zzz);
>      }
>    }
>    }
> 
>   ]]>
>  </mx:Script>
> 
>  <mx:HBox width="1089" id="rightPane" height="630" x="5" y="10"
> verticalScrollPolicy="off" horizontalScrollPolicy="off">
>  <mx:VBox width="230" height="627" verticalGap="10">
>   <mx:Panel width="229" height="628" title="Tree"
verticalScrollPolicy="off"
> horizontalScrollPolicy="off" backgroundColor="white">
>   <mx:Tree id="TreeForm"   change="changeEvt(event)" labelField="@label"
> showRoot="true" width="210" height="595">
>    <mx:XMLListCollection id="nodes">
>    <mx:XMLList>
> 
>    <node label="abc Node" />
>    <node label="Main Forms"  isBranch="true" >
>    <node label="ddd Form"  />
>    <node label="zzz Form"/>
>    </node>
>    </node>
>    </mx:XMLList>
>    </mx:XMLListCollection>
>    </mx:Tree>
>       </mx:Panel>
>  </mx:VBox>
>  </mx:HBox>
> </mx:Canvas>
> 
>  can you suggest me how to achieve this.
> 
> Thanks,
> 
> Tomt.
>


Reply via email to