0 Replies Latest reply on Aug 1, 2007 6:44 PM by Chekote

    BUG: Docked Application Control Bar breaks States

    Chekote
      I've encountered a bug and I haven't noticed messages from anyone else about it so I'm assuming it's an unknown:

      If you use an Application Control Bar, set it's dock property to true, and then attempt to change the currentState of the application to a state that would result in the Application Control Bar to be removed; the state change fails.

      Here's an example:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:states>
      <mx:State name="problemState">
      <mx:AddChild relativeTo="{textarea1}" position="before">
      <mx:Button x="368.5" y="323" label="Goto Base State" click="currentState=&quot;&quot;"/>
      </mx:AddChild>
      <mx:AddChild position="lastChild">
      <mx:ApplicationControlBar x="170" y="221" dock="true" id="appControlBar">
      </mx:ApplicationControlBar>
      </mx:AddChild>
      <mx:AddChild position="lastChild">
      <mx:Button x="360" y="434" label="Undock Control Bar" click="appControlBar.dock = false"/>
      </mx:AddChild>
      <mx:AddChild position="lastChild">
      <mx:Button x="366.5" y="464" label="Dock Control Bar" click="appControlBar.dock = true"/>
      </mx:AddChild>
      <mx:AddChild relativeTo="{appControlBar}" position="before">
      <mx:TextArea x="229.5" y="403" width="396" height="23" editable="false" fontSize="12" fontWeight="bold" textAlign="center" id="textarea0">
      <mx:text>Undocking the control bar at runtime fixes the problem:</mx:text>
      </mx:TextArea>
      </mx:AddChild>
      <mx:AddChild relativeTo="{appControlBar}" position="before">
      <mx:TextArea x="229.5" y="210" width="396" height="105" editable="false" fontSize="12" fontWeight="bold" textAlign="center" id="textarea2">
      <mx:text>If you try and return to the base state while the control bar is docked, the state change will fail. The state change will get &quot;stuck&quot; and you'll have to reload the Flex application. If there was a third state, you could change to that to get out of the lockup, but you still can't transition to any state that would remove the docked Application Control Bar:</mx:text>
      </mx:TextArea>
      </mx:AddChild>
      </mx:State>
      </mx:states>
      <mx:Button x="358.5" y="135" label="Goto Problem State" click="currentState=&quot;problemState&quot;"/>
      <mx:TextArea x="229.5" y="70" width="396" height="57" editable="false" fontSize="12" fontWeight="bold" textAlign="center" id="textarea1">
      <mx:text>A Docked application control bar prevents Flex from changing state to a state that would remove the application control bar.</mx:text>
      </mx:TextArea>
      </mx:Application>