I think it's just a case of the OPs terminology - he expects to see components 
from the base state plus state2 when he switches to state3. I don't think he 
means being in three states at the same time..
  ----- Original Message ----- 
  From: Chet Haase 
  To: [email protected] 
  Sent: Thursday, November 27, 2008 12:56 AM
  Subject: RE: [flexcoders] **View States Problem**


   

  States are mutually exclusive: a given component (such as the component that 
contains the states in your code below) can only be in one state at a time. 
States can be derived from each other, but that's essentially just a way to 
inherit property values from one state to the other; they are still completely 
different states. When you set the 'currentState' property, you will be put 
into that state and that state only.

   

  It's not clear to me what you're trying to accomplish by being in >1 state at 
a time; can you elaborate on the problem you're trying to solve?

   

  Chet.

   

   

  From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
malik_robinson
  Sent: Wednesday, November 26, 2008 4:46 PM
  To: [email protected]
  Subject: [flexcoders] **View States Problem**

   

  Hi,

  I am using Flex 3

  I am trying to use "view states" in my Flex application. My code seems
  to work fine when I just have two "view states", but when I have 3
  states (including the base state), the screen never displays all 3 at
  the same time. I am displaying these states based on the result of a
  remote call, that part works fine so the remoting part of it is not
  the problem.

  In Flexbuilder 3 if I go into design view, I can traverse through the
  states (base, state2, state3), and the visual displays look correct.

  Anyone have any idea or thoughts?

  Here is my code below: 

  <mx:states>

  <mx:State name="state2">

  <mx:AddChild relativeTo="{frm}" position="lastChild" >

  <mx:FormItem label="Select Sub Area:">
  <mx:ComboBox 
  id="cb2"
  dataProvider="{subAreaAC}"
  labelField="state2"
  width="216" left="10" top="40" minWidth="150" />
  </mx:FormItem>

  </mx:AddChild>

  </mx:State>

  <mx:State name="state3" basedOn="state2">

  <mx:AddChild relativeTo="{frm}" position="lastChild" >
  <mx:FormItem label="Select Sub-Sub Area:">
  <mx:ComboBox 
  id="cb3" 
  dataProvider="{subSubAreaAC}"
  labelField="state3" 
  minWidth="150" />
  </mx:FormItem>
  </mx:AddChild>

  </mx:State>

  </mx:states>

  <!-- this is basically my base state, this gets showed by default -->
  <mx:Form id="frm" x="10" y="10">
  <mx:FormItem label="Select a Parent Category:">
  <mx:ComboBox id="cb1" 
  labelField="ParentCategory"
  width="150" left="10" top="40" 
  dataProvider="{catAC}" 
  rowCount="{catAC.length / 2}"
  />
  </mx:FormItem>
  </mx:Form>


   

Reply via email to