1 Reply Latest reply on Apr 5, 2010 10:40 AM by FinFlex

    ViewStack programmatically changing selected item

    Hear me out

      Hi Guys or Ladies

       

      New to flex and here is my scenario:

       

      Using a ViewStack that has multipule custom componentes (forms) in it.

      I have a diffrent navigation control that when clicked should preform two simple tasks.

      1. Change the viewstack selected item according to the clicked item in the navigation control.

      2. Bind Specific data to the inner custom component in the viewstack that should be set to selected already.

       

      Sounds simple ... but for some reason  unknown to me.

      After I set the viewstack selectedchild to the right custom component

      when I try to bind my data to that component I see that the change in the viewstack has occurred yet

      and the component is still null;

       

      Here is the code.

       

       

       

      private function NavigationControl_ItemClick(event:MyCustomEvent):void{

       

      //change viewstack selectedChild

      MyViewStack.selectedChild = ThisSpecificComponent;

       

       

       

      //Bind Data to the new created instance of component in the viewstack

      ThisSpecificComponent.data = event.data;

       

      }

       

      Thanks