1 Reply Latest reply on Jul 18, 2011 12:06 AM by Flex harUI

    Unable to switch between viewstack's children

    idk404

      Hi,

       

      I have a Viewstack with 2 containers:

       

      <mx:ViewStack id="preFeatureViewStack" selectedIndex="{model.viewStackIndexPublicAccess}">

      <s:NavigatorContent id="prefNav1" width="100%" height="100%">

      <view:PreferredFeature />

      </s:NavigatorContent>

      <s:NavigatorContent id="prefNav2" width="100%" height="100%">

      <view:UpdateFeatureLabel />

      </s:NavigatorContent>

      </mx:ViewStack>

       

      The selectedIndex property of Viewstack is bound to a variable, viewStackIndex, in my PresenationModel. I have getters and setters defined for this property.

       

      In PM :

      [Bindable]

      private var viewStackIndex : int;

       

      [Bindable(event="viewStackIndexChange")]

      public function get viewStackIndexPublicAccess () : int {

      Alert.show("in getter");

      return viewStackIndex;

      }

       

      public function set viewStackIndexPublicAccess (viewId : int) : void {

      Alert.show("in setter");

      if(viewStackIndex != viewId) {

      Alert.show("old value = " + viewStackIndex);

      viewStackIndex = viewId;

      Alert.show("new value = " + viewStackIndex);

      dispatcher.dispatchEvent(new Event("viewStackIndexChange"));

      }

      }

       

      I am not able to switch between the viewstack's containers. Any ideas ?

       

      Thanks