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